com.esri.arcgis.carto
Class DataSourceHelper

java.lang.Object
  extended by com.esri.arcgis.carto.DataSourceHelper
All Implemented Interfaces:
IDataSourceHelperLayer, IDataSourceHelperMap, IDataSourceHelperMapDocument, IDataSourceHelperStandaloneTable, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class DataSourceHelper
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IDataSourceHelperMapDocument, IDataSourceHelperMap, IDataSourceHelperLayer, IDataSourceHelperStandaloneTable

Coclass that implements the data source repair methods for MXD.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Constructor Summary
DataSourceHelper()
          Constructs a DataSourceHelper using ArcGIS Engine.
DataSourceHelper(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
DataSourceHelper theDataSourceHelper = (DataSourceHelper) obj;
 
Method Summary
 boolean equals(Object o)
          Compare this object with another
 void findAndReplaceWorkspaceNamePath(IBasicMap pBasicMap, String oldWorkspaceName, String newWorkspaceName, boolean validate)
          String version of ReplaceWorkspaceName; Also does find and replace of parts of the workspace path name.
 void findAndReplaceWorkspaceNamePath(ILayer pLayer, String oldWorkspaceName, String newWorkspaceName, boolean validate)
          Replaces the layer's workspace path name with the given workspace path name; Also does find and replace of parts of the workspace path name.
 void findAndReplaceWorkspaceNamePath(IMapDocument pMapDocument, String oldWorkspaceName, String newWorkspaceName, boolean validate)
          String version of ReplaceWorkspaceName.
 void findAndReplaceWorkspaceNamePath(IStandaloneTable pStandaloneTable, String oldWorkspaceName, String newWorkspaceName, boolean validate)
          Replaces the table's workspace path name with the given workspace path name; Also does find and replace of parts of the workspace path name.
static String getClsid()
          getClsid.
 int hashCode()
          the hashcode for this object
 void repair(IBasicMap pBasicMap, IDataLayer pDataLayer, IName pName, boolean validate)
          Repairs the specified layer and attempt to repair all other broken layers with same workspace path name as the specified layer.
 void repair(IMapDocument pMapDocument, IDataLayer pDataLayer, IName pName, boolean validate)
          Repairs the specified layer and attempt to repair all other broken layers with same workspace path name as the specified layer.
 void replaceName(ILayer pLayer, IName pName, boolean validate)
          Replaces the layer's IName with the given IName.
 void replaceName(IStandaloneTable pStandaloneTable, IName pName, boolean validate)
          Replaces the specified standalone table's IName with the given IName.
 void replaceWorkspaceName(IBasicMap pBasicMap, IWorkspaceName pOldWorkspaceName, IWorkspaceName pNewWorkspaceName, boolean validate)
          Replaces all layers having matching workspace path names with the new workspace name object.
 void replaceWorkspaceName(IMapDocument pMapDocument, IWorkspaceName pOldWorkspaceName, IWorkspaceName pNewWorkspaceName, boolean validate)
          Replaces all layers having matching workspace path names with the new workspace name object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

DataSourceHelper

public DataSourceHelper()
                 throws IOException,
                        UnknownHostException
Constructs a DataSourceHelper using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

DataSourceHelper

public DataSourceHelper(Object obj)
                 throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
DataSourceHelper theDataSourceHelper = (DataSourceHelper) obj;

Construct a DataSourceHelper using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to DataSourceHelper.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

replaceWorkspaceName

public void replaceWorkspaceName(IMapDocument pMapDocument,
                                 IWorkspaceName pOldWorkspaceName,
                                 IWorkspaceName pNewWorkspaceName,
                                 boolean validate)
                          throws IOException,
                                 AutomationException
Replaces all layers having matching workspace path names with the new workspace name object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
replaceWorkspaceName in interface IDataSourceHelperMapDocument
Parameters:
pMapDocument - A reference to a com.esri.arcgis.carto.IMapDocument (in)
pOldWorkspaceName - A reference to a com.esri.arcgis.geodatabase.IWorkspaceName (in)
pNewWorkspaceName - A reference to a com.esri.arcgis.geodatabase.IWorkspaceName (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

repair

public void repair(IMapDocument pMapDocument,
                   IDataLayer pDataLayer,
                   IName pName,
                   boolean validate)
            throws IOException,
                   AutomationException
Repairs the specified layer and attempt to repair all other broken layers with same workspace path name as the specified layer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
repair in interface IDataSourceHelperMapDocument
Parameters:
pMapDocument - A reference to a com.esri.arcgis.carto.IMapDocument (in)
pDataLayer - A reference to a com.esri.arcgis.carto.IDataLayer (in)
pName - A reference to a com.esri.arcgis.system.IName (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findAndReplaceWorkspaceNamePath

public void findAndReplaceWorkspaceNamePath(IMapDocument pMapDocument,
                                            String oldWorkspaceName,
                                            String newWorkspaceName,
                                            boolean validate)
                                     throws IOException,
                                            AutomationException
String version of ReplaceWorkspaceName. Also does find and replace of parts of the workspace path name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
findAndReplaceWorkspaceNamePath in interface IDataSourceHelperMapDocument
Parameters:
pMapDocument - A reference to a com.esri.arcgis.carto.IMapDocument (in)
oldWorkspaceName - The oldWorkspaceName (in)
newWorkspaceName - The newWorkspaceName (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

replaceWorkspaceName

public void replaceWorkspaceName(IBasicMap pBasicMap,
                                 IWorkspaceName pOldWorkspaceName,
                                 IWorkspaceName pNewWorkspaceName,
                                 boolean validate)
                          throws IOException,
                                 AutomationException
Replaces all layers having matching workspace path names with the new workspace name object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
replaceWorkspaceName in interface IDataSourceHelperMap
Parameters:
pBasicMap - A reference to a com.esri.arcgis.carto.IBasicMap (in)
pOldWorkspaceName - A reference to a com.esri.arcgis.geodatabase.IWorkspaceName (in)
pNewWorkspaceName - A reference to a com.esri.arcgis.geodatabase.IWorkspaceName (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

repair

public void repair(IBasicMap pBasicMap,
                   IDataLayer pDataLayer,
                   IName pName,
                   boolean validate)
            throws IOException,
                   AutomationException
Repairs the specified layer and attempt to repair all other broken layers with same workspace path name as the specified layer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
repair in interface IDataSourceHelperMap
Parameters:
pBasicMap - A reference to a com.esri.arcgis.carto.IBasicMap (in)
pDataLayer - A reference to a com.esri.arcgis.carto.IDataLayer (in)
pName - A reference to a com.esri.arcgis.system.IName (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findAndReplaceWorkspaceNamePath

public void findAndReplaceWorkspaceNamePath(IBasicMap pBasicMap,
                                            String oldWorkspaceName,
                                            String newWorkspaceName,
                                            boolean validate)
                                     throws IOException,
                                            AutomationException
String version of ReplaceWorkspaceName; Also does find and replace of parts of the workspace path name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
findAndReplaceWorkspaceNamePath in interface IDataSourceHelperMap
Parameters:
pBasicMap - A reference to a com.esri.arcgis.carto.IBasicMap (in)
oldWorkspaceName - The oldWorkspaceName (in)
newWorkspaceName - The newWorkspaceName (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

replaceName

public void replaceName(ILayer pLayer,
                        IName pName,
                        boolean validate)
                 throws IOException,
                        AutomationException
Replaces the layer's IName with the given IName.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
replaceName in interface IDataSourceHelperLayer
Parameters:
pLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
pName - A reference to a com.esri.arcgis.system.IName (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findAndReplaceWorkspaceNamePath

public void findAndReplaceWorkspaceNamePath(ILayer pLayer,
                                            String oldWorkspaceName,
                                            String newWorkspaceName,
                                            boolean validate)
                                     throws IOException,
                                            AutomationException
Replaces the layer's workspace path name with the given workspace path name; Also does find and replace of parts of the workspace path name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
findAndReplaceWorkspaceNamePath in interface IDataSourceHelperLayer
Parameters:
pLayer - A reference to a com.esri.arcgis.carto.ILayer (in)
oldWorkspaceName - The oldWorkspaceName (in)
newWorkspaceName - The newWorkspaceName (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

replaceName

public void replaceName(IStandaloneTable pStandaloneTable,
                        IName pName,
                        boolean validate)
                 throws IOException,
                        AutomationException
Replaces the specified standalone table's IName with the given IName.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
replaceName in interface IDataSourceHelperStandaloneTable
Parameters:
pStandaloneTable - A reference to a com.esri.arcgis.carto.IStandaloneTable (in)
pName - A reference to a com.esri.arcgis.system.IName (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

findAndReplaceWorkspaceNamePath

public void findAndReplaceWorkspaceNamePath(IStandaloneTable pStandaloneTable,
                                            String oldWorkspaceName,
                                            String newWorkspaceName,
                                            boolean validate)
                                     throws IOException,
                                            AutomationException
Replaces the table's workspace path name with the given workspace path name; Also does find and replace of parts of the workspace path name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
findAndReplaceWorkspaceNamePath in interface IDataSourceHelperStandaloneTable
Parameters:
pStandaloneTable - A reference to a com.esri.arcgis.carto.IStandaloneTable (in)
oldWorkspaceName - The oldWorkspaceName (in)
newWorkspaceName - The newWorkspaceName (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.