Package org.geoserver.catalog

Examples of org.geoserver.catalog.MetadataMap


            try {
                Object value = g.invoke(object, null);
                if (value == null) {
                    if (Map.class.isAssignableFrom(type)) {
                        if (MetadataMap.class.isAssignableFrom(type)) {
                            value = new MetadataMap();
                        } else {
                            value = new HashMap();
                        }
                    } else if (List.class.isAssignableFrom(type)) {
                        value = new ArrayList();
View Full Code Here


       
        @Override
        public void marshal(Object source, HierarchicalStreamWriter writer,
                MarshallingContext context) {
            if ( source instanceof MetadataMap) {
                MetadataMap mdmap = (MetadataMap) source;
                source = mdmap.getMap();
            }
           
            super.marshal(source, writer, context);
        }
View Full Code Here

       
        @Override
        public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
            Map map = (Map) super.unmarshal(reader, context);
            if ( !(map instanceof MetadataMap ) ) {
                map = new MetadataMap(map);
            }
            return map;
        }
View Full Code Here

                GeoServerInfoImpl global = (GeoServerInfoImpl) xpf.createXMLPersister().load( in, GeoServerInfo.class );
                // fill in default collection values if needed
                //JD: this should not be here, it should be moved to a resolve() method
                // on GeoServer, like the way the catalog does it
                if(global.getMetadata() == null)
                    global.setMetadata(new MetadataMap());
                if(global.getClientProperties() == null)
                    global.setClientProperties(new HashMap<Object, Object>());
                geoServer.setGlobal( global );   
            }
           
View Full Code Here

            try {
                Object value = g.invoke( object, null );
                if ( value == null ) {
                    if ( Map.class.isAssignableFrom( type ) ) {
                        if ( MetadataMap.class.isAssignableFrom( type ) ) {
                            value = new MetadataMap();
                        }
                        else {
                            value = new HashMap();
                        }
                    }
View Full Code Here

                            }
                    ));
                }
            });

            MetadataMap meta = new MetadataMap();
            meta.put(Metadata.CREATED, new Date());
            meta.put(Metadata.MODIFIED, new Date());
            when(map.getMetadata()).thenReturn(meta);

            Catalog catalog = workspaceBuilder.catalogBuilder.catalog;
            when(catalog.getLayerGroup(id)).thenReturn(map);
            when(catalog.getLayerGroupByName(name)).thenReturn(map);
View Full Code Here

            id = id != null ? id : UUID.randomUUID().toString();
            when(layer.getId()).thenReturn(id);
            when(layer.getName()).thenReturn(name);
            when(layer.prefixedName()).thenReturn(wsName+":"+name);

            MetadataMap meta = new MetadataMap();
            meta.put(Metadata.CREATED, new Date());
            meta.put(Metadata.MODIFIED, new Date());
            when(layer.getMetadata()).thenReturn(meta);

            Catalog catalog = workspaceBuilder.catalogBuilder.catalog;
           
            when(catalog.getLayer(id)).thenReturn(layer);
View Full Code Here

    static final String CREATED = "created";
    static final String MODIFIED = "modified";

    public static void created(Info obj, Date created) {
        MetadataMap map = map(obj);
        map.put(CREATED, created);
        map.put(MODIFIED, created);
    }
View Full Code Here

    static MetadataMap map(Info obj) {
        Object map = OwsUtils.get(obj, "metadata");
        if (map != null && map instanceof MetadataMap) {
            return (MetadataMap) map;
        }
        return new MetadataMap();
    }
View Full Code Here

        org.geoserver.data.util.IOUtils.copy(input, file);
    }

    private void setupESRIFormatByDefault(GeoServer geoServer, Boolean value) throws IOException {
        WFSInfo wfsInfo = geoServer.getService(WFSInfo.class);
        MetadataMap metadata = wfsInfo.getMetadata();
        metadata.put(ShapeZipOutputFormat.SHAPE_ZIP_DEFAULT_PRJ_IS_ESRI, value);
        geoServer.save(wfsInfo);
    }
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.