Returns the ArcIMS ArcXML response to an ArcXML request. AimsTransformer acts as a simple
gateway between Cocoon and ArcIMS. To use it you should have a good understanding of
ArcIMS and ArcXML. For those not in the know, ArcIMS is a proprietary piece of software,
which happens to be pretty expensive (about 10.000 USD).
In order to compile the
whole Geoid library, a mock class has been added to simulate the one contained in
arcims_appserverlink.jar. To make the connector work you have to use the real stuff from
ESRI though.
<map:transformer name="aims"
src="org.cocoondev.geoid.transformation.AimsTransformer"
server="cranach"
port="5300"
mapservice="erato"/>
The configuration parameters specific to AimsTransformer are:
<map:transform type="aims"/>
The XML document to send to the transformer may contain any elements, be them ArcXML ones or not, but only the one enclosed in a "request" element and prefixed by the "aims" namespace are sent to ArcIMS. Hence, a typical document may look like:
<?xml version="1.0" encoding="iso-8859-1"?>
<aims:request xmlns:aims="http://cocoondev.org/geoid/aims">
<aims:GET_IMAGE autoresize="true" show="false">
<aims:PROPERTIES>
<aims:IMAGESIZE width="494.7" height="732.35"/>
<aims:ENVELOPE minx="313361" miny="3933722"
maxx="1312124" maxy="5220507"/>
<aims:LAYERLIST>
<aims:LAYERDEF id="3" visible="true"/>
</aims:LAYERLIST>
</aims:PROPERTIES>
</aims:GET_IMAGE>
</aims:request>
After ArcIMS processes this request, the result may look like:
<ARCXML version="1.1">
<RESPONSE>
<IMAGE>
<ENVELOPE minx="313361" miny="3837140,29352227"
maxx="1312124" maxy="5317088,70647773"/>
<OUTPUT file="C:\tmp\arcims\output\erato_CRANACH129215640.jpg"
url="/tmparcims/erato_CRANACH129215640.jpg"/>
</IMAGE>
</RESPONSE>
</ARCXML>
Which may be further processed to turn it into an HTML page.
Since the ArcXML documents tend to be dynamic (at the very least, map coordinates change
at nearly every request), an XSLT may be useful to produce the ArcXML document.
Following listings shows the sitemap and the XSLT used for this sample:
<map:match name="wildcard" pattern="map.html">
<map:generate type="file" src="parameters.xml"/>
<map:transform type="xlst" src="stylesheets/map/sample.xsl">
<map:parameter name="map-width" value="{request-param:mapwidth}"/>
<map:parameter name="map-height" value="{request-param:mapheight}"/>
<map:parameter name="min-x" value="{request-param:minx}"/>
<map:parameter name="min-y" value="{request-param:miny}"/>
<map:parameter name="max-x" value="{request-param:maxx}"/>
<map:parameter name="max-y" value="{request-param:maxy}"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
This sitemap has been produced with Cocoon 2.1 and shows the use of input modules to pass request parameters to an XSLT transformation.
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:aims="http://cocoondev.org/geoid/aims"
>
<xsl:param name="logo-width"/>
<xsl:param name="map-width"/>
<xsl:param name="map-height"/>
<xsl:param name="min-x"/>
<xsl:param name="min-y"/>
<xsl:param name="max-x"/>
<xsl:param name="max-y"/>
<xsl:template match="/">
<xsl:element name="request"
namespace="http://cocoondev.org/geoid/aims">
<xsl:element name="GET_IMAGE"
namespace="http://cocoondev.org/geoid/aims">
<xsl:attribute name="autoresize">true</xsl:attribute>
<xsl:attribute name="show">false</xsl:attribute>
<xsl:element name="PROPERTIES"
namespace="http://cocoondev.org/geoid/aims">
<xsl:element name="IMAGESIZE"
namespace="http://cocoondev.org/geoid/aims">
<xsl:attribute name="width">
<xsl:value-of select="$map-width"/>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:value-of select="$map-height"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="ENVELOPE"
namespace="http://cocoondev.org/geoid/aims">
<xsl:attribute name="minx">
<xsl:value-of select="$min-x"/>
</xsl:attribute>
<xsl:attribute name="miny">
<xsl:value-of select="$min-y"/>
</xsl:attribute>
<xsl:attribute name="maxx">
<xsl:value-of select="$max-x"/>
</xsl:attribute>
<xsl:attribute name="maxy">
<xsl:value-of select="$max-y"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="LAYERLIST"
namespace="http://cocoondev.org/geoid/aims">
<xsl:element name="LAYERDEF"
namespace="http://cocoondev.org/geoid/aims">
<xsl:attribute name="id">3</xsl:attribute>
<xsl:attribute name="visible">true</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
It has been tested with:
ArcIMS 3.1, 4.0, 4.0.1
Cocoon 2.0.3, 2.0.4, 2.1.3,
2.1.5
Since this transformer is based on the AppServerLink connector, which has been deprecated by ESRI, its suitability for future versions of ArcIMS is doubtful.
The DEBUG log level is pretty verbose: the ArcXML documents of every request and every response are logged.