com.esri.arcgis.carto
Class MSDHelper

java.lang.Object
  extended by com.esri.arcgis.carto.MSDHelper
All Implemented Interfaces:
IMSDHelper, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class MSDHelper
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IMSDHelper

Coclass implementing methods to open, save, repair mapserver definition files.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
MSDHelper()
          Constructs a MSDHelper using ArcGIS Engine.
MSDHelper(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
MSDHelper theMSDHelper = (MSDHelper) obj;
 
Method Summary
 void close()
          Close the mapserver defintion file.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 String getDataset(String layerPath)
          Given the layer's catalog path, returns the dataset name.
 String getLayerDisplayName(String layerPath)
          Given the layer's catalog path, returns its TOC display name.
 IStringArray getLayers(String mapPath)
          Given the map's catalog path, returns the catalog path for all layers in the map.
 String getLayerType(String layerPath)
          Given the layer's catalog path, returns the layer type.
 String getMapDisplayName(String mapPath)
          Given the map's catalog path returns the map's TOC display name.
 IStringArray getMaps()
          Method returns a String Array containing the catalog paths to all the maps in the msd.
 IStringArray getSubLayers(String layerPath)
          Given the layer's catalog path, returns the catalog path to its sub layers, if it has any.
 String getWorkspaceConnectionStringFromLayer(String layerPath)
          Given the layer's catalog path, returns the workspace connection string.
 String getWorkspaceFactoryType(String layerPath)
          Given the layer's catalog path, returns the workspace type.
 int hashCode()
          the hashcode for this object
 boolean isActiveMap(String mapPath)
          Given the map's catalog path, returns a boolean inidicating if it is the active map.
 boolean isLayerValid(String layerPath)
          Given the layer's catalog path, returns a boolean indicating if it is valid.
 void open(String path)
          Open the mapserver definition file.
 void putWorkspaceConnectionStringInLayer(String layerPath, String workspaceConnectionString, boolean validate)
          Given the layer's catalog path, updates its workspace connection string.
 void replaceAll(String mapPath, String oldWorkspaceConnectionString, String newWorkspaceConnectionString, boolean validate)
          Replaces the workspace connection string for all layers in the given map.
 void save(boolean relativePath)
          Save the mapserver defintion file.
 void saveAs(String path, boolean relativePath)
          Save a copy of the open mapserver definition file at the specified location with the specified name.
 
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

MSDHelper

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

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

MSDHelper

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

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

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

open

public void open(String path)
          throws IOException,
                 AutomationException
Open the mapserver definition file.

Product Availability

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

Specified by:
open in interface IMSDHelper
Parameters:
path - The path (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

close

public void close()
           throws IOException,
                  AutomationException
Close the mapserver defintion file.

Product Availability

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

Specified by:
close in interface IMSDHelper
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

save

public void save(boolean relativePath)
          throws IOException,
                 AutomationException
Save the mapserver defintion file.

Product Availability

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

Specified by:
save in interface IMSDHelper
Parameters:
relativePath - The relativePath (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

saveAs

public void saveAs(String path,
                   boolean relativePath)
            throws IOException,
                   AutomationException
Save a copy of the open mapserver definition file at the specified location with the specified name.

Product Availability

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

Specified by:
saveAs in interface IMSDHelper
Parameters:
path - The path (in)
relativePath - The relativePath (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMaps

public IStringArray getMaps()
                     throws IOException,
                            AutomationException
Method returns a String Array containing the catalog paths to all the maps in the msd.

Product Availability

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

Specified by:
getMaps in interface IMSDHelper
Returns:
A reference to a com.esri.arcgis.system.IStringArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isActiveMap

public boolean isActiveMap(String mapPath)
                    throws IOException,
                           AutomationException
Given the map's catalog path, returns a boolean inidicating if it is the active map.

Product Availability

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

Specified by:
isActiveMap in interface IMSDHelper
Parameters:
mapPath - The mapPath (in)
Returns:
The activeMap
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMapDisplayName

public String getMapDisplayName(String mapPath)
                         throws IOException,
                                AutomationException
Given the map's catalog path returns the map's TOC display name.

Product Availability

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

Specified by:
getMapDisplayName in interface IMSDHelper
Parameters:
mapPath - The mapPath (in)
Returns:
The mapDisplayName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

replaceAll

public void replaceAll(String mapPath,
                       String oldWorkspaceConnectionString,
                       String newWorkspaceConnectionString,
                       boolean validate)
                throws IOException,
                       AutomationException
Replaces the workspace connection string for all layers in the given map.

Product Availability

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

Specified by:
replaceAll in interface IMSDHelper
Parameters:
mapPath - The mapPath (in)
oldWorkspaceConnectionString - The oldWorkspaceConnectionString (in)
newWorkspaceConnectionString - The newWorkspaceConnectionString (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayers

public IStringArray getLayers(String mapPath)
                       throws IOException,
                              AutomationException
Given the map's catalog path, returns the catalog path for all layers in the map.

Product Availability

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

Specified by:
getLayers in interface IMSDHelper
Parameters:
mapPath - The mapPath (in)
Returns:
A reference to a com.esri.arcgis.system.IStringArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isLayerValid

public boolean isLayerValid(String layerPath)
                     throws IOException,
                            AutomationException
Given the layer's catalog path, returns a boolean indicating if it is valid.

Product Availability

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

Specified by:
isLayerValid in interface IMSDHelper
Parameters:
layerPath - The layerPath (in)
Returns:
The layerValid
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayerType

public String getLayerType(String layerPath)
                    throws IOException,
                           AutomationException
Given the layer's catalog path, returns the layer type.

Product Availability

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

Specified by:
getLayerType in interface IMSDHelper
Parameters:
layerPath - The layerPath (in)
Returns:
The layerType
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSubLayers

public IStringArray getSubLayers(String layerPath)
                          throws IOException,
                                 AutomationException
Given the layer's catalog path, returns the catalog path to its sub layers, if it has any.

Product Availability

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

Specified by:
getSubLayers in interface IMSDHelper
Parameters:
layerPath - The layerPath (in)
Returns:
A reference to a com.esri.arcgis.system.IStringArray
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDataset

public String getDataset(String layerPath)
                  throws IOException,
                         AutomationException
Given the layer's catalog path, returns the dataset name.

Product Availability

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

Specified by:
getDataset in interface IMSDHelper
Parameters:
layerPath - The layerPath (in)
Returns:
The datasetName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getWorkspaceFactoryType

public String getWorkspaceFactoryType(String layerPath)
                               throws IOException,
                                      AutomationException
Given the layer's catalog path, returns the workspace type.

Product Availability

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

Specified by:
getWorkspaceFactoryType in interface IMSDHelper
Parameters:
layerPath - The layerPath (in)
Returns:
The workspaceFactoryType
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getWorkspaceConnectionStringFromLayer

public String getWorkspaceConnectionStringFromLayer(String layerPath)
                                             throws IOException,
                                                    AutomationException
Given the layer's catalog path, returns the workspace connection string.

Product Availability

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

Specified by:
getWorkspaceConnectionStringFromLayer in interface IMSDHelper
Parameters:
layerPath - The layerPath (in)
Returns:
The workspaceConnectionString
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

putWorkspaceConnectionStringInLayer

public void putWorkspaceConnectionStringInLayer(String layerPath,
                                                String workspaceConnectionString,
                                                boolean validate)
                                         throws IOException,
                                                AutomationException
Given the layer's catalog path, updates its workspace connection string.

Product Availability

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

Specified by:
putWorkspaceConnectionStringInLayer in interface IMSDHelper
Parameters:
layerPath - The layerPath (in)
workspaceConnectionString - The workspaceConnectionString (in)
validate - The validate (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLayerDisplayName

public String getLayerDisplayName(String layerPath)
                           throws IOException,
                                  AutomationException
Given the layer's catalog path, returns its TOC display name.

Product Availability

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

Specified by:
getLayerDisplayName in interface IMSDHelper
Parameters:
layerPath - The layerPath (in)
Returns:
The layerDisplayName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.