Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: UDIG 1.2.RC1
-
Fix Version/s: UDIG 1.2.RC3
-
Component/s: database
-
Labels:None
-
Environment:JDK 1.6.0_18, gtk.linux.x86_64
Description
I'm implementing a custom ActionTool working on a PostGIS layer, and I need to access the underlying DataSource from the tool implementation. I'm not sure if the following code is the best way of doing so, but with this approach, I hit a bug in PostgisSchemaFolder
ILayer layer = getContext().getSelectedLayer();
try
{
IService service = layer.getGeoResource().resolve(IService.class, null);
IResolve member = service.members(null).get(0);
boolean canResolve = member.canResolve(JDBCDataStore.class);
if (canResolve)
}
catch (IOException exc)
member is of class PostgisSchemaFolder. canResolve() returns true for JDBCDataStore, but resolve() only works for DataStore, not for JDBCDataStore. I locally patched the resolve() method, replacing DataStore by JDBCDataStore to make things work.