Package org.geoserver.web.data.resource

Examples of org.geoserver.web.data.resource.DataStorePanelInfo


        }
        if (app == null) {
            throw new NullPointerException("GeoServerApplication param");
        }

        DataStorePanelInfo panelInfo = findPanelInfo(storeInfo, app);
        if (panelInfo == null || panelInfo.getComponentClass() == null) {
            // there's either no panel info specific for this kind of store, or it provides no
            // component class
            panelInfo = getDefaultPanelInfo(storeInfo, app);
        }
        final Class<StoreEditPanel> componentClass = panelInfo.getComponentClass();

        final Constructor<StoreEditPanel> constructor;
        try {
            constructor = componentClass.getConstructor(String.class, Form.class);
        } catch (SecurityException e) {
View Full Code Here


    private static DataStorePanelInfo getDefaultPanelInfo(StoreInfo storeInfo,
            GeoServerApplication app) {

        final List<DataStorePanelInfo> providers = app.getBeansOfType(DataStorePanelInfo.class);

        DataStorePanelInfo panelInfo = null;

        for (DataStorePanelInfo provider : providers) {
            if (storeInfo instanceof DataStoreInfo && "defaultVector".equals(provider.getId())) {
                panelInfo = provider;
                break;
            } else if (storeInfo instanceof CoverageStoreInfo
                    && "defaultRaster".equals(provider.getId())) {
                panelInfo = provider;
                break;
            }
        }

        if (panelInfo == null) {
            if (storeInfo instanceof DataStoreInfo) {
                throw new IllegalStateException("Bean of type DataStorePanelInfo named "
                        + "'defaultDataStorePanel' not provided by application context");
            } else if (storeInfo instanceof CoverageStoreInfo) {
                throw new IllegalStateException("Bean of type DataStorePanelInfo named "
                        + "'defaultCoverageStorePanel' not provided by application context");
            } else {
                throw new IllegalArgumentException("Unknown store type: "
                        + storeInfo.getClass().getName());
            }
        }

        if (panelInfo.getComponentClass() == null) {
            throw new IllegalStateException("Default DataStorePanelInfo '" + panelInfo.getId()
                    + "' does not define a componentClass property");
        }

        if (panelInfo.getIconBase() == null || panelInfo.getIcon() == null) {
            throw new IllegalStateException("Default DataStorePanelInfo '" + panelInfo.getId()
                    + "' does not define default icon");
        }

        return panelInfo;
    }
View Full Code Here

            throw new IllegalArgumentException("Can't locate the factory for the store");
        }

        final List<DataStorePanelInfo> providers = app.getBeansOfType(DataStorePanelInfo.class);

        DataStorePanelInfo panelInfo = null;

        for (DataStorePanelInfo provider : providers) {
            Class<?> providerFactoryClass = provider.getFactoryClass();
            if (factoryClass.equals(providerFactoryClass)) {
                panelInfo = provider;
View Full Code Here

        }
        if (app == null) {
            throw new NullPointerException("GeoServerApplication param");
        }

        DataStorePanelInfo panelInfo = findPanelInfo(storeInfo, app);
        if (panelInfo == null || panelInfo.getComponentClass() == null) {
            // there's either no panel info specific for this kind of store, or it provides no
            // component class
            panelInfo = getDefaultPanelInfo(storeInfo, app);
        }
        final Class<StoreEditPanel> componentClass = panelInfo.getComponentClass();

        final Constructor<StoreEditPanel> constructor;
        try {
            constructor = componentClass.getConstructor(String.class, Form.class);
        } catch (SecurityException e) {
View Full Code Here

    private static DataStorePanelInfo getDefaultPanelInfo(StoreInfo storeInfo,
            GeoServerApplication app) {

        final List<DataStorePanelInfo> providers = app.getBeansOfType(DataStorePanelInfo.class);

        DataStorePanelInfo panelInfo = null;

        for (DataStorePanelInfo provider : providers) {
            if (storeInfo instanceof DataStoreInfo && "defaultVector".equals(provider.getId())) {
                panelInfo = provider;
                break;
            } else if (storeInfo instanceof CoverageStoreInfo
                    && "defaultRaster".equals(provider.getId())) {
                panelInfo = provider;
                break;
            }
        }

        if (panelInfo == null) {
            if (storeInfo instanceof DataStoreInfo) {
                throw new IllegalStateException("Bean of type DataStorePanelInfo named "
                        + "'defaultDataStorePanel' not provided by application context");
            } else if (storeInfo instanceof CoverageStoreInfo) {
                throw new IllegalStateException("Bean of type DataStorePanelInfo named "
                        + "'defaultCoverageStorePanel' not provided by application context");
            } else {
                throw new IllegalArgumentException("Unknown store type: "
                        + storeInfo.getClass().getName());
            }
        }

        if (panelInfo.getComponentClass() == null) {
            throw new IllegalStateException("Default DataStorePanelInfo '" + panelInfo.getId()
                    + "' does not define a componentClass property");
        }

        if (panelInfo.getIconBase() == null || panelInfo.getIcon() == null) {
            throw new IllegalStateException("Default DataStorePanelInfo '" + panelInfo.getId()
                    + "' does not define default icon");
        }

        return panelInfo;
    }
View Full Code Here

                            return -1;
                        }
                    });
            //check first two and make sure bindings are not equal
            DataStorePanelInfo f1 = fallbacks.get(0);
            DataStorePanelInfo f2 = fallbacks.get(1);

            if (f1.getFactoryClass().equals(f2.getFactoryClass())) {
                String msg = "Multiple editor panels for : (" + f1.getFactoryClass() + "): " + f1 + ", " + f2;
                throw new RuntimeException(msg);
            }
           
            return f1;
View Full Code Here

TOP

Related Classes of org.geoserver.web.data.resource.DataStorePanelInfo

Copyright © 2018 www.massapicom. 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.