|
| URL Paths | Discussion Forum |
| IMF Developer's Guide » URL Paths |
In the XML configuration files, there are many places that require a URL to be entered. For example, the location of the layer configuration XML file, the tab actions and graphics, and the tool graphics all need to specify the URL to the image or document. A layer may specify a custom URL for report handling.
You may enter the complete URLs (starting with http://) for these entries, but in order to make it easier for you to migrate your applications from a development to production environments, the URLs specified in the XML files are assumed to be relative from the place that the URL is being read from.
If the site configuration is located at http://123.45.6.789/example/site.xml and contains:
<layer-config-xml url="layer-config.xml" />
then the URL is expanded to read:
<layer-config-xml url="http://123.45.6.789/example/layer-config.xml" />
Other common relative methods also work, so:
<data-frame url="/about.html" /> <tab graphic="../graphics/green_about.gif" />
would be expanded to:
<data-frame url="http://123.45.6.789/about.html" /> <tab graphic="http://123.45.6.789/graphics/green_about.gif" />
In order to allow this and avoid the requirement to put explicit paths to the framework documents and tools, The XML parser recognizes an environment variable to specify the URL path to the framework ($FRAMEWORK). $FRAMEWORK refers to the URL path to the directory where imf.jsp exists. The following is an example of references to framework documents and using this method.
<button name="Print"
url="$FRAMEWORK/imfPrintScaledMapForm.jsp"
target="dataFrame"
hint="Print"
status="Opens the map in a document suitable for printing."
graphic="$FRAMEWORK/tools/print_1.gif"
width="16" height="16" />
Note that this routine is applicable to all occurrences of URLs in XML files only.