Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Catalog and styles

Wellmann, Harald wrote:
How does the catalog interact with services and associated styles?
The Catalog has two things going on .... when a layer is created from a georesource... - the georesource is asked if it can resolve to a Style - if so the Style is placed on the style blackboard and will later be used for rendering (see IGeoResource documentation for details) - or if that does not work a new style will be created (see StyleContext interface for details)

A GeoResource can actually be taught new abilities; allowing you to teach a georesource to resolve to a style of your own choice (perhaps based on FeatureType?). If you are familiar with OGC Catalog servers this is similar to have an "association" between data / feature type / style. In the uDig catalog we try and talk about these IGeoResource implementations being "friends".
I'm working with my own IService (which resolves to DataStore) and my own IGeoResources (which resolve to FeatureSource and Style). The style is constructed from an SLD resource in my plugin. I want all my resources to have a predefined style, and the user is not supposed to change it.
That should be working for you - please check which class you need to resolve to - if you need Style, FeatureTypeStyle or StyleLayerDescriptor.
This works fine when I first create a map. When I close and restart uDig, somehow the catalog intervenes, and the control flow is different, my default style creation never gets executed, and my map layers are rendered with some fallback style created by uDig.
I see; sounds like your style is not getting saved on the style blackboard correctly. Are their any errors in the logs? You are talking about when you reopen an map you previously created right?
How can I make sure that the catalog not only remembers my services but also the associated styles? Or how can I disable the catalog? (I must admit I do not really understand what it is good for, at least not for file-based datastores...)
If you are working with shapefiles; you can save an SLD document with the same name.

Jody


Back to the top