On Fri, Nov 14, 2014 at 11:31 AM, Andrea Aime <[email protected]>
wrote:
> Hi,
> another issue that came up with JDBCConfig is that we found it breaks when
> dealing with derived properties.
>
> There are two types of derived properties:
> * computed ones, that lack a getter, such as "prefixedName()"
> * delegated ones, that lack a field, and point directly to the value in
> another object, for example LayerInfo enabled/advertised
>
DbMappings.properties() already have a couple hacks for some derived
properties. I guess the easiest path forward would be to build on top of
that and add a couple more conditionals?
>
> For the derived ones, I wanted to use
> PublishedInfo/LayerInfo/LayerGroupInfo/.prefixedName... but JDBCConfig does
> not
> see it, because it does not have a getter, whilst it sees the ResoruceInfo
> one because there is a deprecated getPrefixedName()
> method.
> For the time being, to move forward, I've added getPrefixedName() to
> PublishedInfo too (and subclasses), but I guess it would
> be best if we had a way to declare these derived properties that only have
> a getter, to allow filtering/sorting on them.
> Maybe we could have a derived_properties.properties, in the same spirit as
> nested_properties.properties?
>
> The delegated ones are nasty... JDBCConfig saves LayerInfo
> enabled/advertised in the db at the time of import,
> and then the GUI only touches ResourceInfo advertised/enabled, so the code
> saving them only saves the change
> in ResourceInfo, but not in LayerInfo.
> For these it would be nice to just have nested_properties.propertise
> handle the case such as:
> LayerInfo.enabled=ResourceInfo.enabled
> LayerInfo.advertised=ResourceInfo.advertised
>
why not just build a filter like enabled=true AND resource.enabled = true
AND resource.store.enabled = true
Otherwise how will you differentiate from enabled and enabled (that is,
isEnabled() and enabled())?
> since in the end we are accessing a nested property.
>
> One final nasty case is title, which is exposed as a property in
> PublishedInfo, and it is direct in LayerGroupInfo,
> but when it comes to layers, there is a direct property that is never
> used, and we actually live off the title of the nested
> resource.
> I guess a delegation declaration such as:
> LayerInfo.title=ResourceInfo.title
> would do the trick, and we can kill LayerInfo own title? It does not seem
> anything is using it anyways
>
that sounds about right to me. Although multiple LayerInfo's may exist for
the same ResourceInfo (Catalog's List<LayerInfo> getLayers( ResourceInfo
resource ) method?).
So why not let LayerInfo.title live instead? It looks to me like it'd be
better that way, and client code would be free to make a null check on
LayerInfo.getTitle() and fallback to its resource title if deemed
appropriate?
my 2c/
Gabriel
>
> Cheers
> Andrea
>
> --
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/NWWaa2 for more information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054 Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39 339 8844549
>
> 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.
>
> -------------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Comprehensive Server Monitoring with Site24x7.
> Monitor 10 servers for $9/Month.
> Get alerted through email, SMS, voice calls or mobile push notifications.
> Take corrective actions from your mobile device.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
> _______________________________________________
> Geoserver-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
>
--
Gabriel Roldán
Software Developer | Boundless <http://boundlessgeo.com/>
[email protected]
@boundlessgeo <http://twitter.com/boundlessgeo/>
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel