Hi all,

Recently I have been dealing with some use cases that require the ability to inject some native filters, specific for each feature type and non static over time, to the final native query build by GeoTools and
send to the data store.

For example, the content of a feature type is partially controlled by an external service who provides a non
static native query (the request changes over time) that filters the content 
that should be show.

Another use case is a complex authorization rules system where the 
authorization rules are SQL
expressions that need to be append to the final SQL WHERE clause build by 
GeoTools, the system
provides SQL expressions for different databases (Oracle, PostgreSQL, MySQL, 
etc ...).

Most of the native filters of this use cases are quite complex and can't be 
translated to OGC filters.

Since we have a pattern here that can be applied to several use cases and data stores I have think about an approach that would allow extensions, external code, etc ... to inject the necessary native filter(s)
and allow data stores implementations to handle those native filters in an 
harmonized way.

I have come up with the idea of a new filter named /NativeFilter/:

 * this filter will NOT be directly usable by the final users, for example in 
WFS requests

 * if any code try to evaluate it in memory an exception will be throw

 * it will not break any API and data stores will be free to implement is 
support has needed

 * it will have a method getNative() that will return a String containing the 
native filter

A new default method would need to be added to the /FilterVisitor/ interface 
and a default
implementation would need to be added to /AsbtractFilterVisitor and 
DuplicatingFilterVisitor /
classes (like for any other filter).

The data store who wants to supports this filter will need to extends it custom 
visitor, for example,
for relational databases we only need to add a new visit method to 
/FilterToSQL/ visitor.

This gives the necessary flexibility for third party code (codes that use 
GeoTools) to inject native
filters without any specific extension points or cumbersome handling. It is 
also worth notice unless
some code is using native filters this will have no impact on other usages.

Any thoughts on this ? Objections ?

King regards,

Nuno Oliveira

--
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V 
for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

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

-------------------------------------------------------
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003
Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i 
file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo 
è consentito esclusivamente al destinatario del messaggio, per le finalità 
indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne 
il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di 
procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro 
sistema. Conservare il messaggio stesso, divulgarlo anche in parte, 
distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, 
costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to