You can call InterMapper RemoteAccess from a command line, and control a significant number of functions. This can be useful for automating the updating of maps, or for various testing purposes.
InterMapper RemoteAccess currently supports the following command-line arguments:
The syntax for Windows users is essentially the same as the Linux/Unix examples below, except that the command line requires the full Windows path to InterMapper's Java installation (rather than any other installations of Java that might exist on the machine.) The following example sets the working directory to the .jar file, then invokes java with the .jar file:
cd "[jar file location]" "C:\Program Files\InterMapper\java\bin\java" -jar \[jar file name].jar
Remember to use this approach for all of the examples below, replacing java with the full path to the InterMapper Java installation.
To import to a specified server, IM Remote is invoked as follows:
java -jar <jar-file> --host <intermapper-server> [--user <username> --pass <password>] --import <import-file>
The example below reads imported data from newdata.tab.
java -jar intermapper_remoteaccess.jar --host big.dartware.com --user admin --pass adminpw --import newdata.tab
The example below reads imported data from stdin.
java -jar intermapper_remoteaccess.jar --host big.dartware.com --user admin --pass adminpw --import -
The stdin form of the --import option allows Unix users to create self-contained executable files that import stuff:
#!/usr/bin/java -jar intermapper_remoteaccess.jar --host big.dartware.com --import -
#import blah blah blah
blah blah blah
blah blah blah
One use for this would be to automate testing of InterMapper Server.
To export from a specified server, IM Remote is invoked as follows:
java -jar <jar-file> --host <intermapper-server> [--user <username> --pass <password>] \ --export "format=<output-type> table=<table-name> fields=<field-list>
The example below writes exported data to stdout.
java -jar intermapper_remoteaccess.jar --host big.dartware.com --user admin --pass adminpw --export "format=tab table=devices fields=*"