Moxi Media Inc.
IMF Startup Description Discussion Forum

IMF Developer's Guide » Application Startup Description  

To understand the configuration discussion, you should be aware of the ways that the site can be initialized, and what is actually going on behind the scenes when it starts.

The IMF application can be called several ways from a web browser. Examples of the different methods appear below:

1. http://server.com/ows/imf.jsp?conf=http://anyserver.com/aquifers/site-config.xml
2. http://server.com/ows/imf.jsp?conf=http://anyserver.com/aquifers/site-config.xml&extent=10000,10000,20000,30000
3. http://server.com/ows/imf.jsp?site=aquifers
4. http://server.com/ows/imf.jsp?site=aquifers&extent=10000,10000,20000,30000

Note that the server and installation path (ows) used here is just an example. The URL used to start the IMF application will be different in actual installations.

Using the conf parameter

When imf.jsp is called using the conf parameter, it attempts to locate the site configuration file (it doesn't need to be called site-config.xml) and parses the XML. An error is displayed if there are problems finding or parsing the file.

The site configuration XML contains information about the site contents like the title, buttons and tools, and a reference to the map configuration XML file. The map configuration file is then processed to determine the map settings and the layers that will be available for your site. If there are problems reading or parsing the file, or if there are no layers present at the end of the process, an error message is displayed.

The command line can also contain an extent parameter to specify the initial extent of the map. If present, the initial map will be presented at the extent shown instead of the extent defined in the map configuration file. This is useful for links to an IMF site that should be opened showing a specific area of interest.

Using the site parameter (recommended)

The conf parameter is ugly, and exposes information about your site to the user in the address bar of the browser. An alternate startup routine exists to enable you to refer to your XML documents by name instead of using the URL of the XML configuration file in the startup URL.

To set up a site, simply create an entry in the file called site.properties that exists in the WEB-INF directory of your IMF installation. The entry assigns a name and the related site-configuration file used to open that site. Please refer to the following example:

# site.properties
#
# Specifies the location of site configuration files for known
# applications so that the application can be called using
# http://yourserver.com/ows/imf.jsp?site=sitename
#
# format: site_name = url to site configuration file

aquifers = http://anyserver.com/aquifers/site-config.xml
recreation = http://anyserver.com/recreation/site-config.xml

Calling the imf.jsp script with the site= parameter results in the same as if it were called with the related XML file using the conf= parameter. If there is an extent parameter on the request, it will be applied as expected.