Hi all,
I'm trying to solve a bug with the GeoTools WMS client, that when
contacting a GeoServer service with inspire extensions enabled, throws
exception and it's very slow to complete the GetCapabilities request.
This is very annoing because it prevents use of this type of services with
the GeoServer WMS cascading feature.

The first problem is easily solved, removing in
org.geotools.xml.handlers.ElementHandlerFactory the type check in
method createElementHandler:

public XMLElementHandler createElementHandler(Element eth)
        throws SAXException {
        Type type = eth.getType();

        // REMOVE THIS BLOCK TO PREVENT EXCEPTION WITH INSPIRE UNKNOWN
ELEMENTS
        if (type == null) {
        return new IgnoreHandler(eth);
            //throw new SAXException("Type not found for " + eth.getName()
+ " ");
        }

        if (type instanceof SimpleType) {
            return new SimpleElementHandler(eth);
        }
        if (type instanceof ComplexType) {
            return new ComplexElementHandler(this, eth);
        }


        return new IgnoreHandler(eth);
    }

The slowness instead is due to schema downloads from the w3c web site. To
solve this one too, I thought to add the option to load some schemas
locally in org.geotools.xml.SchemaFactory.
I thought of a configurable mechanism to add and use local schema files in
place of remote ones.
I have two options:
 * simplest one: SchemaFactory looks in classpath for schemas.properties
files containing uri -> localpath bindings used for preloading and caching
schemas. The content of schema.properties would be similar to this one:

http://www.w3.org/2001/xml.xsd=xml.xsd

 * more extensible one: a new interface SchemaLoader could be introduced.
to delegate schema loading; the interface will have two methods:
  - boolean canLoad(URL url)
  - Schema loadSchema(URL url)
   SchemaLoader implementation will be looked up with the SPI method during
startup and used to load schemas when needed.

Opinions?

Thanks.

-- 
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:     +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to