|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.esri.adf.web.ags.util.AGSUtil
public class AGSUtil
A Utility class for converting different entities between ArcObjects and SOAP APIs and between SOAP and Web ADF APIs. Web ADF Geometries do not support z-coordinates and m attributes.
The following Sample illustrates how AGSUtil.serializeArcObject and AGSUtil.deserializeStub methods can be used.
// Create an ArcObject Polyline and convert to Stub PolylineN object IPoint fromPt = (Point) soc.createObject(Point.getClsid()); fromPt.setX(-117); fromPt.setY(34.0); IPoint toPt = (Point) soc.createObject(Point.getClsid()); toPt.setX(-113.0); toPt.setY(40); SpatialReferenceEnvironment sr = (SpatialReferenceEnvironment) soc.createObject(SpatialReferenceEnvironment.getClsid()); IGeographicCoordinateSystem coords = sr.createGeographicCoordinateSystem(esriSRGeoCSType.esriSRGeoCS_WGS1984); fromPt.setSpatialReferenceByRef(coords); toPt.setSpatialReferenceByRef(coords); Polyline pLine = (Polyline) soc.createObject(Polyline.getClsid()); pLine.setFromPoint(fromPt); pLine.setToPoint(toPt); pLine.setSpatialReferenceByRef(coords); // Creating PolylineN Stub Object String str = AGSUtil.serializeArcObject(pLine, soc); PolylineN pLineN = (PolylineN) AGSUtil.deserializeStub(str, PolylineN.class);
| Method Summary | |
|---|---|
static java.lang.Object |
createArcObjectFromStub(java.lang.Object stubObject,
com.esri.arcgis.server.IServerContext context)
Deprecated. This method is deprecated as of ArcGIS Java Server 9.3.1, use AGSLocalUtil.createArcObjectFromStub(Object, com.esri.arcgis.server.IServerContext) |
static java.lang.Object |
createStubFromArcObject(java.lang.Object arcObject,
java.lang.Class<?> stubClass,
com.esri.arcgis.server.IServerContext context)
Deprecated. This method is deprecated as of ArcGIS Java Server 9.3.1, use AGSLocalUtil.createStubFromArcObject(Object, Class, com.esri.arcgis.server.IServerContext) |
static java.lang.Object |
deserializeArcObject(java.lang.String xmlStr,
com.esri.arcgis.server.IServerContext context)
Deprecated. This method is deprecated as of ArcGIS Java Server 9.3.1, use AGSLocalUtil.deserializeArcObject(String, com.esri.arcgis.server.IServerContext) |
static java.lang.Object |
deserializeStub(java.lang.String xmlStr,
java.lang.Class<?> _class)
Returns an object corresponding to its submitted serialized string representation |
static WebGeometry |
fromAGSGeometry(com.esri.arcgisws.Geometry geometry)
Converts com.esri.arcgisws.Geometry to WebGeometry. |
static WebRenderer |
fromAGSRenderer(com.esri.arcgisws.FeatureRenderer agsRenderer,
WebSymbol defaultSymbol)
Converts com.esri.arcgisws.FeatureRenderer to com.esri.adf.web.data.renderer.WebRenderer |
static WebSpatialReference |
fromAGSSpatialReference(com.esri.arcgisws.SpatialReference sr)
Converts SpatialReference to WebSpatialReference. |
static WebSymbol |
fromAGSSymbol(com.esri.arcgisws.Symbol agsSymbol)
Converts com.esri.arcgisws.Symbol to WebSymbol. |
static java.lang.String |
getEsriUnitsDisplayText(com.esri.arcgisws.EsriUnits units)
Returns a String describing EsriUnits constant. |
static com.esri.arcgisws.EsriImageFormat |
getImageFormat(java.lang.String format)
Deprecated. Please use AGSMapResource#getImageFormat(String) instead. |
static com.esri.arcgisws.LayerDescription |
getLayerDescription(int id,
com.esri.arcgisws.LayerDescription[] layerDescs)
Returns a LayerDescription with the given index |
static com.esri.arcgisws.MapLayerInfo |
getLayerInfo(int id,
com.esri.arcgisws.MapLayerInfo[] layerInfos)
Returns a MapLayerInfo with the given index |
static com.esri.arcgisws.MapLayerInfo |
getLayerInfo(java.lang.String layerName,
com.esri.arcgisws.MapLayerInfo[] layerInfos)
Returns a MapLayerInfo with the given layer name |
static java.lang.String |
getLocalServerVersion(com.esri.arcgis.server.IServerObjectManager serverObjectManager)
Deprecated. This method is deprecated as of ArcGIS Java Server 9.3.1, use AGSLocalUtil.getLocalServerVersion(IServerObjectManager) |
static java.lang.String |
getServerVersion(com.esri.arcgisws.ServiceCatalogBindingStub catalog)
Given a catalog binding stub ServiceCatalogBindingStub, return the version of ArcGIS Server. |
static java.lang.String |
getServerVersion(java.net.URL url)
Given a catalog URL, return the version of ArcGIS Server. |
static java.net.URL |
getServiceCatalogURL(java.net.URL url)
Returns the service catalog URL from the specified ArcGIS Service URL. |
static java.lang.String |
serializeArcObject(java.lang.Object arcObject,
com.esri.arcgis.server.IServerContext context)
Deprecated. This method is deprecated as of ArcGIS Java Server 9.3.1, use AGSLocalUtil.serializeArcObject(Object, com.esri.arcgis.server.IServerContext) |
static java.lang.String |
serializeStub(java.lang.Object obj)
Serializes a given Object into a String |
static com.esri.arcgisws.Geometry |
toAGSGeometry(WebGeometry webGeometry)
Converts WebGeometry to com.esri.arcgisws.Geometry |
static com.esri.arcgisws.SpatialReference |
toAGSSpatialReference(WebSpatialReference wsr)
Converts WebSpatialReference to SpatialReference. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static com.esri.arcgisws.SpatialReference toAGSSpatialReference(WebSpatialReference wsr)
wsr - an instance of WebSpatialReference
public static WebSpatialReference fromAGSSpatialReference(com.esri.arcgisws.SpatialReference sr)
sr - an instance of SpatialReference
public static com.esri.arcgisws.Geometry toAGSGeometry(WebGeometry webGeometry)
webGeometry - an instance of WebGeometry to be converted
public static WebGeometry fromAGSGeometry(com.esri.arcgisws.Geometry geometry)
geometry - an instance of com.esri.arcgisws.Geometry to be converted
public static WebRenderer fromAGSRenderer(com.esri.arcgisws.FeatureRenderer agsRenderer,
WebSymbol defaultSymbol)
agsRenderer - an instance of com.esri.arcgisws.FeatureRenderer to be converteddefaultSymbol - a default WebSymbol that is used if agsRenderer does not refer to a valid
com.esri.arcgisws.Symbol
public static WebSymbol fromAGSSymbol(com.esri.arcgisws.Symbol agsSymbol)
agsSymbol - an instance of com.esri.arcgisws.Symbol to be converted
public static com.esri.arcgisws.LayerDescription getLayerDescription(int id,
com.esri.arcgisws.LayerDescription[] layerDescs)
id - indexlayerDescs - an array of LayerDescriptions
public static java.net.URL getServiceCatalogURL(java.net.URL url)
For Example,
String mapserverURL = "http://localhost:8399/arcgis/services/USA/Mapserver";
URL catalogURL = AGSUtil.getServiceCatalogURL(new URL(mapserverURL));
System.out.println("Catalog URL : " + catalogURL);
url - a ArcGIS Service URL
public static java.lang.String getServerVersion(java.net.URL url)
For Example,
String mapserverURL = "http://localhost:8399/arcgis/services/USA/Mapserver";
URL catalogURL = AGSUtil.getServiceCatalogURL(new URL(mapserverURL));
System.out.println("Catalog URL : " + catalogURL);
String version = AGSUtil.getServerVersion(catalogURL);
System.out.println("ArcGIS Server Version : " + version);
url - a ArcGIS Internet Catalog Service URL
public static java.lang.String getServerVersion(com.esri.arcgisws.ServiceCatalogBindingStub catalog)
ServiceCatalogBindingStub, return the version of ArcGIS Server.
For Example,
String mapserverURL = "http://localhost:8399/arcgis/services/USA/Mapserver";
URL catalogURL = AGSUtil.getServiceCatalogURL(new URL(mapserverURL));
System.out.println("Catalog URL : " + catalogURL);
ServiceCatalogBindingStub catalog = new ServiceCatalogBindingStub(catalogURL, null);
catalog.setUsername("uname");
catalog.setPassword("pwd");
String version = AGSUtil.getServerVersion(catalog);
System.out.println("ArcGIS Server Version : " + version);
catalog - the Service catalog binding stub object
public static com.esri.arcgisws.MapLayerInfo getLayerInfo(int id,
com.esri.arcgisws.MapLayerInfo[] layerInfos)
id - MapLayerInfo indexlayerInfos - an array of MapLayerInfos
public static com.esri.arcgisws.MapLayerInfo getLayerInfo(java.lang.String layerName,
com.esri.arcgisws.MapLayerInfo[] layerInfos)
layerName - a layer namelayerInfos - an array of MapLayerInfos
@Deprecated public static com.esri.arcgisws.EsriImageFormat getImageFormat(java.lang.String format)
AGSMapResource#getImageFormat(String) instead.
format - a String defining the image format
public static java.lang.String getEsriUnitsDisplayText(com.esri.arcgisws.EsriUnits units)
units - a EsriUnits constant
public static java.lang.Object deserializeStub(java.lang.String xmlStr,
java.lang.Class<?> _class)
xmlStr - serialized string representation of the resulting object_class - resulting object's class
public static java.lang.String serializeStub(java.lang.Object obj)
obj - an Object to serialize
@Deprecated public static java.lang.String getLocalServerVersion(com.esri.arcgis.server.IServerObjectManager serverObjectManager)
AGSLocalUtil.getLocalServerVersion(IServerObjectManager)
serverObjectManager - an instance of IServerObjectManager
@Deprecated
public static java.lang.Object createArcObjectFromStub(java.lang.Object stubObject,
com.esri.arcgis.server.IServerContext context)
AGSLocalUtil.createArcObjectFromStub(Object, com.esri.arcgis.server.IServerContext)
stubObject - an com.esri.arcgisws stubcontext - an instance of IServerContext
@Deprecated
public static java.lang.Object createStubFromArcObject(java.lang.Object arcObject,
java.lang.Class<?> stubClass,
com.esri.arcgis.server.IServerContext context)
AGSLocalUtil.createStubFromArcObject(Object, Class, com.esri.arcgis.server.IServerContext)
arcObject - ArcObjects object to be convertedstubClass - the class of resulting com.esri.arcgisws stubcontext - an instance of IServerContext
@Deprecated
public static java.lang.Object deserializeArcObject(java.lang.String xmlStr,
com.esri.arcgis.server.IServerContext context)
AGSLocalUtil.deserializeArcObject(String, com.esri.arcgis.server.IServerContext)
xmlStr - object's String representationcontext - an instance of IServerContext
@Deprecated
public static java.lang.String serializeArcObject(java.lang.Object arcObject,
com.esri.arcgis.server.IServerContext context)
AGSLocalUtil.serializeArcObject(Object, com.esri.arcgis.server.IServerContext)
arcObject - an ArcObjects object to be serializecontext - an instance of IServerContext
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||