Sure, the user opens a layer from the system (the layer will be saved in the database as well) and it opens using the predefined style that is saved in the database. If the user changes the style and they have the permissions the style will change for everyone the next time they load the layer. An example would be the user wants to see all of the fire hydrants in the city, they open the hydrant layer and it opens displaying as red hydrant icons for every point in the layer.
To me it looks like SLDContent doesn't actually know enough about the layer to be used to load and save the layer from the database, the StyleBlackboard however does have enough information for me to know which layer I am referring to so it seems we will just have to modify that plug-in and from now on patch that change back in every time we update. Justin From: [email protected] [mailto:[email protected]] On Behalf Of Jody Garnett Sent: Tuesday, January 27, 2009 4:35 AM To: User-friendly Desktop Internet GIS Subject: Re: [udig-devel] How does one change the saving and loading sld styleinformation? Let us break down your use case a bit more; right now we load and save a project / map / layer data structure from disk. Are you looking to save everything in the database? Or are you looking to "override" part of the normal load/save process and force some centrally defined styles onto an already existing Map? Can you give me your requirement in user terms? Back to your technical question - please review the following class: - http://svn.refractions.net/udig/udig/trunk/plugins/net.refractions.udig. style.sld/src/net/refractions/udig/style/sld/SLDContent.java This should provide enough detail for you read in a blob of SLD from your database and apply it to an existing layer. Jody On Tue, Jan 27, 2009 at 1:29 AM, Justin R. Lynch <[email protected]> wrote: The closest would be to save the style information into a database, so when someone opens a layer (also saved in the database) they will be using the same style. Justin -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jody Garnett Sent: Friday, January 23, 2009 9:21 PM To: User-friendly Desktop Internet GIS Subject: Re: [udig-devel] How does one change the saving and loading sld styleinformation? There are a couple of aspects to what you are talking about. You mentioned making use of a database so I am going to take a couple wild guesses to try and figure out what you are getting at based on what others have done. The uDig load/save mechanism for Maps is all about saving this information into a project directory. In the past people have wanted to either: - save this information too and from a databases so users can work on a common set of maps - save this information too and from an Open Web Context document (to be attached to a wiki page) - save just the style information into a database and "update" existing maps to use the latest style from the common central database In each one of these cases you are going to get in there making your own maps and layers; taking charge of the process your application uses to assemble a working Map data structure for udig to draw. Let me know which one of the above scenarios you are working towards and I can try and make more specific recommendations. (the general idea is that these are just data structures so you can "load" and "save" them as you see fit) If I can ask you to review the IRC logs from this weeks meeting; Moovida requested a new "export style" extension point be created; it is not quite related to your request here - except in that it will represent another example of saving and loading a style to a file. Jody Justin R. Lynch wrote: > > Greetings everyone. We are currently using the sld style to render the > layers for our project. We need to change where the information about > a layer's style is saved and loaded. We would like to be able to save > / load this information from a database. It seems that a SLDContent > (net.refractions.udig.style.sld) currently loads /saves this > information from the eclipse IMemento. If we were creating our own > style and renderer we could use these methods to instead load / save > to the database but I don't know how to use the sld style provided and > replace just the save and load. The best I can come up with is to use > copy / paste reuse and basically copy all of the > net.refractions.udig.style.sld plug-in into another plug-in and just > change those two functions. > > Am I missing something? What is the correct way to change this > functionality? > > If I create a new style that just re-implements the StyleContent, > won't I have problems making that style get selected over the sld style? > > Thanks, > > Justin > > ------- > > The information contained in this message may be company sensitive and > is for the intended addressee only. Any unauthorized use, > dissemination of the information, or copying of this message is > prohibited. If you are not the intended addressee, please notify the > sender immediately and delete this message. > > -------- > > ------------------------------------------------------------------------ > > _______________________________________________ > User-friendly Desktop Internet GIS (uDig) > http://udig.refractions.net > http://lists.refractions.net/mailman/listinfo/udig-devel > _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.13/1916 - Release Date: 1/26/2009 7:08 AM _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.176 / Virus Database: 270.10.14/1918 - Release Date: 1/27/2009 7:26 AM
_______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel
