Package org.geoserver.ows.util

Examples of org.geoserver.ows.util.CaseInsensitiveMap


        Map result = new HashMap();
        for (Iterator it = input.keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
            result.put(key.toUpperCase(), input.get(key));
        }
        return new CaseInsensitiveMap(result);
    }
View Full Code Here


            return false;
        }

        void encodeKMLLink(MapLayer mapLayer, int drawOrder, Envelope box){
            //copy the format options
            CaseInsensitiveMap fo = new CaseInsensitiveMap(new HashMap());
            fo.putAll( mapContext.getRequest().getFormatOptions() );
               
            //we want to pass through format options except for superoverlay, we need to
            // turn it off so we get actual placemarks back, and not more links
            fo.remove( "superoverlay");
           
            //get the regionate mode
            String overlayMode = (String)fo.get("overlayMode");
           
            if ("overview".equalsIgnoreCase(overlayMode)){
                //overview mode, turn off regionation
                fo.remove( "regionateBy" );
            }
            else {
                //specify regionateBy=auto if not specified
                if ( !fo.containsKey( "regionateBy") ) {
                    fo.put( "regionateBy", "auto");   
                }
               
            }
           
            String foEncoded = WMSRequests.encodeFormatOptions(fo);
View Full Code Here

        this.applicationContext = applicationContext;
    }

    public Object parse(String value) throws Exception {
        List parsers = GeoServerExtensions.extensions(KvpParser.class, applicationContext);
        Map formatOptions = new CaseInsensitiveMap(new HashMap());

        //TODO: refactor some of this routine out into utility class since
        // much of the logic is duplicated from the dispatcher
        StringTokenizer st = new StringTokenizer(value, ";");

        while (st.hasMoreTokens()) {
            String kvp = (String) st.nextToken();
            String[] kv = kvp.split(":");

            String key = null;
            String raw = null;

            if (kv.length == 1) {
                //assume its a on/off (boolean) kvp
                key = kv[0];
                raw = "true";
            } else {
                key = kv[0];
                raw = kv[1];
            }

            Object parsed = null;

            for (Iterator p = parsers.iterator(); p.hasNext();) {
                KvpParser parser = (KvpParser) p.next();
                if ( key.equalsIgnoreCase( parser.getKey() ) ) {
                    parsed = parser.parse( raw );
                    if ( parsed != null ) {

                        break;
                    }
                }
            }

            if (parsed == null) {
                if(LOGGER.isLoggable(Level.FINER))
                    LOGGER.finer( "Could not find kvp parser for: '" + key + "'. Storing as raw string.");
                parsed = raw;
            }

            formatOptions.put(key, parsed);
        }

        return formatOptions;
    }
View Full Code Here

            return false;
        }

        void encodeKMLLink(MapLayer mapLayer, int drawOrder, Envelope box) {
            // copy the format options
            CaseInsensitiveMap fo = new CaseInsensitiveMap(new HashMap());
            fo.putAll(mapContext.getRequest().getFormatOptions());

            // we want to pass through format options except for superoverlay, we need to
            // turn it off so we get actual placemarks back, and not more links
            fo.remove("superoverlay");

            // get the regionate mode
            String overlayMode = (String) fo.get("overlayMode");

            if ("overview".equalsIgnoreCase(overlayMode)) {
                // overview mode, turn off regionation
                fo.remove("regionateBy");
            } else {
                // specify regionateBy=auto if not specified
                if (!fo.containsKey("regionateBy")) {
                    fo.put("regionateBy", "auto");
                }

            }

            String foEncoded = WMSRequests.encodeFormatOptions(fo);
View Full Code Here

        Map result = new HashMap();
        for (Iterator it = input.keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
            result.put(key.toUpperCase(), input.get(key));
        }
        return new CaseInsensitiveMap(result);
    }
View Full Code Here

                .getDimensionDescriptors(coverageName);
        for (DimensionDescriptor dd : dimensionDescriptors) {
            result.put(dd.getName(), dd);
        }

        return new CaseInsensitiveMap(result);

    }
View Full Code Here

        super.setUpTestData(testData);
    }

    @SuppressWarnings("unchecked")
    protected GetCoverageType parse(String url) throws Exception {
        Map<String, Object> rawKvp = new CaseInsensitiveMap(KvpUtils.parseQueryString(url));
        Map<String, Object> kvp = new CaseInsensitiveMap(parseKvp(rawKvp));
        WCS20GetCoverageRequestReader reader = new WCS20GetCoverageRequestReader();
        GetCoverageType gc = (GetCoverageType) reader.createRequest();
        return (GetCoverageType) reader.read(gc, kvp, rawKvp);
    }
View Full Code Here

            return false;
        }

        void encodeKMLLink(Layer layer, int drawOrder, Envelope box) {
            // copy the format options
            CaseInsensitiveMap fo = new CaseInsensitiveMap(new HashMap());
            fo.putAll(mapContent.getRequest().getFormatOptions());

            // we want to pass through format options except for superoverlay, we need to
            // turn it off so we get actual placemarks back, and not more links
            fo.remove("superoverlay");

            // get the regionate mode
            String overlayMode = (String) fo.get("overlayMode");

            if ("overview".equalsIgnoreCase(overlayMode)) {
                // overview mode, turn off regionation
                fo.remove("regionateBy");
            } else {
                // specify regionateBy=auto if not specified
                if (!fo.containsKey("regionateBy")) {
                    fo.put("regionateBy", "auto");
                }

            }

            String foEncoded = WMSRequests.encodeFormatOptions(fo);
View Full Code Here

        Map result = new HashMap();
        for (Iterator it = input.keySet().iterator(); it.hasNext();) {
            String key = (String) it.next();
            result.put(key.toUpperCase(), input.get(key));
        }
        return new CaseInsensitiveMap(result);
    }
View Full Code Here

        // hack to allow wcs filters to work... we should really upgrade the WCS models instead...
        Request r = Dispatcher.REQUEST.get();
        if (r != null) {
            Map kvp = new HashMap(r.getKvp());
            r.setKvp(new CaseInsensitiveMap(parsed));
        }

        return reader.read(reader.createRequest(), parsed, original);
    }
View Full Code Here

TOP

Related Classes of org.geoserver.ows.util.CaseInsensitiveMap

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.