Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm using arcObjects 9.2.6 java librairies to change connection/path properties within a java prog. This prog aims to change path and connection properties for all layers of an mxd file. It works well with Layers wich use Shape file. It also works well with layers from Database whith no joins. However when a joins to another table exists on layers it does not work.

what i do for database layers is :

dataSetName = datasetName.getName();
propertySet = (IPropertySet) new PropertySet();
propertySet.setProperty(SDE_SERVER, properties.get(SDE_SERVER));
propertySet.setProperty(SDE_INSTANCE, properties.get(SDE_INSTANCE));
propertySet.setProperty(SDE_DATABASE, properties.get(SDE_DATABASE));
propertySet.setProperty(SDE_USER, properties.get(SDE_USER));
propertySet.setProperty(SDE_PASSWORD, properties.get(SDE_PASSWORD));
propertySet.setProperty(SDE_VERSION, properties.get(SDE_VERSION));
workspaceNameCible = (IWorkspaceName2) new WorkspaceName();
workspaceNameCible.setWorkspaceFactoryProgID(SDE_SOURCE_ID);
workspaceNameCible.setConnectionProperties(propertySet);
datasetName.setWorkspaceNameByRef(workspaceNameCible);
if (dataSetName.contains(".")) {
  datasetName.setName(dataSetName.replaceAll(dataSetName.substring(0, dataSetName.indexOf(".")), properties.get(SDE_USER).toString()));
}

This correctly changed the connection information of the layer but not the joins.

For example if my layer contains a join on a table identified by sde_user.my_table and i execute the code to change the sde_user to sde_user2, the layer will have sde_user2 but the joins still remains on sde_user.my_table (where i expect sde_user2.my_table).

I've searched how to get the joins from the layer and see if it is possible to change their connection properties but i've found nothing.

Any suggestions ??

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.