[email protected] ha scritto: > I have an additional proposal. What about a plugin mechanism > > public interface VirtualTableProvider { > public Set<VirtualTable> createVirtualTables(Connection con) > throws SQLException > } > > having a dummy implementation returning an empty list. > > Of course, this means a new optional datastore param > "VirtualTableProviderClassName". > > I did something similar with the PregeneralizedDataStore. The default > implementation reads from an xml file, for my project I created > another plugin fetching this information from DB2. > > Opinions
Something like this could be used at the datastore level, and yes, GeoServer could inject in a version that reads from its own catalog in order to still support GUI configuration of new types. We would still need a resource pool callback to inject in the virtual table provider. I'd prefer a setter in the jdbcdatastore class as opposed to a datastore parameter specifying a class, the latter is way too much convoluted. What I don't like about this option is that it makes using virtual tables harder for the gt2 programmer. The code would go from: store.addVirtualTable(virtualTable) to ((DefaultVirtualTableProvider) store.getVirtualTableProvider()).add(virtualTable) (I'm assuming the provider replaces the current vt handling, having both of them would be more confusing). If you want a plugin that reads from the database you could roll your own GeoSErver module that uses the above cited resource pool callback to configure your virtual tables. That might not suit your use case fully though, my guess is that you want your provider to make queries to the database every time it's asked for a virtual table, whilst what I'm suggesting would be a one off operation that would not react to changes in the underlying database. If you really want to go your way state that in a public proposal on the gt2 devel soon (I wanted to apply the existing virtual table patch, to trunk only, this week). I honestly don't like it much, but I will not vote it down either (a -0 position, don't like it, but not strongly opposed either). Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------------ _______________________________________________ Geoserver-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-devel
