[udig-devel] PostGIS connection problems
Jesse Eichar
jeichar at refractions.net
Mon Feb 11 11:18:58 PST 2008
I don't think I want this functionality as part of core uDig, at least
not yet. Because I am worried that it will add a lot of overhead for
a case that is not common enough. There is a way to do this yourself.
map.getEditManager().addListener( listener ).
The listener will receive a PostCommit event that you can use to reset
the resource:
catalog = Catalog.getDefault().getLocalCatalog();
service = catalog.getById( IService.class, url );
params = service.getParams();
replacement =
Catalog.getDefault().getServiceFactory().createService( params );
catalog.replace( service.getURL(), replacement );
I think that's how to do it.
Jesse
Le 9-Feb-08 à 7:47 AM, David Garbin a écrit :
> In RC14, Refresh on the PostGIS service in the catalog works. It is
> cumbersome and is something that should probably be done
> automatically whenever a change to the database is committed. Here
> is the sequence of events that I perform now to interact with
> PostGIS layers:
>
> 1. All the displayed layers are views in PostGIS. There is a
> "control table" in PostGIS which is displayed in Table window in uDig.
> 2. I change the control parameters in the Table window.
> 3. I hit the commit toolbar button (for some reason, the Commit
> menu item is grayed out).
> 4. I bring up the Catalog window and Reset the PostGIS service,
> then minimize the Catalog window.
> 5. I hit the refresh toolbar button and new contents of the view
> are displayed.
>
> In the workspace, it doesn't take up too much real estate to have
> the Table window open at the bottom with the control row displayed,
> but I can't afford the space to have the Catalog window always
> visible.
>
> As I indicated above, could a commit action automatically kick off a
> service reset as part of its processing if this is necessary for it
> to work?
>
> On Feb 3, 2008, at 12:56 PM, Jody Garnett wrote:
>
>> Dave S-B wrote:
>>> This seems to be the same behaviour as I am finding with users
>>> deleting catalog services (e.g. MapGraphic/custom services) - see
>>> the "Protecting Catalog Services". I tried this with a PostGIS
>>> service too - the same thing happens. The missing service is
>>> recreated correctly when you open a project/map containing
>>> relevant layers, but the layers which previously used this service
>>> just can't seem to reference the recreated service correctly. With
>>> MapGraphic, the resource ID of the layer actually gets changed at
>>> some point (so it's always going to be pointing to the wrong
>>> place). With PostGIS layers, the resource ID stays the same, but
>>> it still can't reference the service/resource correctly. I tried
>>> looking in the .umap file for clues, but the catalogRef was huge
>>> and full of too many codes for my brain! The iD was correct though.
>> Yeah it was confusing for me too; I had to step through the code to
>> figure it out. Here is what I remember:
>> - There is a some net.refractions.udig.catalog code that reads an
>> IMenento and looks-up or creates a serivce if needed. This code is
>> used by the catalog when it starts up.
>> - The same code is subclased by the net.refractoins.udig.project
>> plug-in and used when a Map is loaded to connect the layers to
>> their data.
>>
>> So perhaps what we need is a "Refresh" at the layer level;
>> something to kick it into looking at the catalog again? I had kind
>> of hoped that this would be done by each renderer but I think
>> LayerImpl had to start caching...
>>
>> Cheers,
>> Jody
>>> I will try and look into this some more on Monday to find the root
>>> of the problem.
>>>
>>> Jody Garnett wrote:
>>>> Still I am happy to find a user to test this scenario. We have a
>>>> related concern with moved shapefiles; a Map really should be
>>>> able to kick a catalog entry into life as needed.
>>>> Can you give me any details about what happened when you tried
>>>> Reset? Did anything happen at all?
>>>>
>>>> Jody
>>
>>
>> _______________________________________________
>> 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
More information about the udig-devel
mailing list