Package org.geoserver.catalog

Examples of org.geoserver.catalog.MetadataMap


        this.onlineResource = onlineResource;
    }

    public MetadataMap getMetadata() {
        if (metadata == null) {
            metadata = new MetadataMap();
        }
        return metadata;
    }
View Full Code Here


            List<AttributeTypeInfo> attributes = fti.getAttributes();
            for (AttributeTypeInfo attr : attributes) {
                ftb.add(attr.getName(), attr.getBinding());
            }
            ft = ftb.buildFeatureType();
            MetadataMap metadata = fti.getMetadata();
            if (metadata.containsKey("importschemanames")) {
                Map<Object, Object> userData = ft.getUserData();
                userData.put("schemanames", metadata.get("importschemanames"));
            }
        }
        return read(ft, file);
    }
View Full Code Here

            resource.setLatLonBoundingBox(EMPTY_BOUNDS);
            resource.getMetadata().put("recalculate-bounds", Boolean.TRUE);

            Map<Object, Object> userData = featureType.getUserData();
            if (userData.containsKey("schemanames")) {
                MetadataMap metadata = resource.getMetadata();
                metadata.put("importschemanames", (Serializable) userData.get("schemanames"));
            }

            ImportTask task = new ImportTask(data);
            task.setLayer(layer);
            task.getMetadata().put(FeatureType.class, featureType);
View Full Code Here

        if (name == null) {
            throw new RestletException("No layer name specified", Status.CLIENT_ERROR_BAD_REQUEST);
        }
        final Catalog catalog = geoserver.getCatalog();
        CatalogInfo layer = catalog.getLayerByName(name);
        MetadataMap mdmap;
        if (layer == null) {
            layer = catalog.getLayerGroupByName(name);
            if (layer == null) {
                throw new RestletException("Layer " + name + " not found",
                        Status.CLIENT_ERROR_NOT_FOUND);
            }
            mdmap = ((LayerGroupInfo) layer).getMetadata();
        } else {
            mdmap = ((LayerInfo) layer).getMetadata();
        }

        Boolean enabled = mdmap.get(Properties.INDEXING_ENABLED, Boolean.class);
        if (enabled == null || !enabled.booleanValue()) {
            throw new RestletException("Layer " + name + " not found",
                    Status.CLIENT_ERROR_NOT_FOUND);
        }
        final Context context = getContext();
View Full Code Here

        clone.setFactoryClass(factoryClass);
        if(filteredProcesses != null) {
            clone.setFilteredProcesses(new ArrayList<Name>(filteredProcesses));
        }
        if(metadataMap != null) {
            clone.metadataMap = new MetadataMap(new HashMap<String, Serializable>(metadataMap));
        }
       
        return clone;
    }
View Full Code Here

        }else{
            GeoServerInfo gsInfo = GeoServerExtensions.bean(GeoServer.class).getGlobal();
            // Global info should be always not null
            if(gsInfo != null){
                SettingsInfo info = gsInfo.getSettings();
                MetadataMap map = info != null ? info.getMetadata() : null;
                if(map != null && map.containsKey(RESTUtils.QUIET_ON_NOT_FOUND_KEY)){
                    quietOnNotFound = map.get(RESTUtils.QUIET_ON_NOT_FOUND_KEY, Boolean.class);
                }
            }
        }
        if(quietOnNotFound == null){
            quietOnNotFound = DEFAULT_QUIET_ON_NOT_FOUND;
View Full Code Here

        GeoServerInfo global = getGeoServer().getGlobal();
        // Selections of the SettingsInfo associated to the GlobalSettings
        SettingsInfoImpl info = (SettingsInfoImpl) ModificationProxy.unwrap(global.getSettings());
        // If no metadata map is present, then a new one is added
        if (info.getMetadata() == null) {
            info.setMetadata(new MetadataMap());
        }
        // Selection of the metadata
        MetadataMap map = info.getMetadata();
        // Addition of the key associated to the root directory
        map.put(RESTUtils.ROOT_KEY, root);
        // Insertion of the settings inside the global ones
        global.setSettings(info);
        // Save settings
        getGeoServer().save(global);
        // Test of the input file
View Full Code Here

        // Creation of new Settings to test
        SettingsInfoImpl info = new SettingsInfoImpl();
       
        // Setting of the metadata map if not present
        if (info.getMetadata() == null) {
            info.setMetadata(new MetadataMap());
        }
        // Selection of the metadata map
        MetadataMap map = info.getMetadata();
        // Addition of the key associated to the root directory
        map.put(RESTUtils.ROOT_KEY, root);
        // Associate the workspace to the settings
        info.setWorkspace(ws);
        // Add the new Settings
        getGeoServer().add(info);
        // Test of the input file
View Full Code Here

                "/rest/workspaces/wcs/coveragestores/BlueMarble", xml, "text/xml");
        assertEquals(200, responseBefore.getStatusCode());
        // Selection of the coverage store
        CoverageStoreInfo cs = getCatalog().getCoverageStoreByName("wcs", "BlueMarble");
        // Setting of the store configuration
        MetadataMap map = cs.getMetadata();
        // Addition of the key associated to the root directory
        map.put(RESTUtils.ROOT_KEY, root);
        // Saving the store
        getCatalog().save(cs);
        // Test of the input file
        testFile(rootFile, "wcs", "BlueMarble");
    }
View Full Code Here

        @Override
        public Object doUnmarshal(Object result, HierarchicalStreamReader reader,
                UnmarshallingContext context) {

            LayerInfoImpl li = (LayerInfoImpl) super.doUnmarshal(result, reader, context);
            MetadataMap metadata = li.getMetadata();
            if (li.getAuthorityURLs() == null && metadata != null) {
                String serialized = metadata.get("authorityURLs", String.class);
                List<AuthorityURLInfo> authorities;
                if (serialized == null) {
                    authorities = new ArrayList<AuthorityURLInfo>(1);
                } else {
                    authorities = AuthorityURLInfoInfoListConverter.fromString(serialized);
                }
                li.setAuthorityURLs(authorities);
            }
            if (li.getIdentifiers() == null && metadata != null) {
                String serialized = metadata.get("identifiers", String.class);
                List<LayerIdentifierInfo> identifiers;
                if (serialized == null) {
                    identifiers = new ArrayList<LayerIdentifierInfo>(1);
                } else {
                    identifiers = LayerIdentifierInfoListConverter.fromString(serialized);
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.MetadataMap

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.