wiki:ParameterFileFormat

Here's a proposal for the format of the parameter file. To start with, only 2 types of arguments will be recognized and allowed:

  • file parameters (file names)
  • directory parameters (directory names)

In the future, we might add others such as url or datastore.

A sample file might look something like this:

file:/data/groups/me581/assmt1.txt
file(diagram):/home/nanohub/mmc/indeed/cache0012
directory(context):/tmp

In general, the syntax is type:value or type(name):value.

The value for the file keyword must be an absolute file path for the desired file. The middleware checks the file path to make sure that the file exists and throws an error if not. This prevents malicious attacks where the invoker might pass an arbitrary string (e.g., ;rm -rf *) as a parameter, and a naive client just appends the string to a command line and invokes the command. The cms and middleware do not perform file path existence checks. The cms checks the for an allowed type and will only check that the url encoded string matches a set of

The value for the directory keyword must be an absolute directory path. The middleware checks the file path to make sure that the directory exists and throws an error if not.

If we added a datastore type some day, the value might be some sort of table identifier, optional view identifier, and an optional series of rows. For example, a value like

datastore:132/stdview/1,5,8

where 132 is the datastore table, stdview is the view name, and 1,5,81 are the desired rows. These values are separated by /.

Any parameter can have an optional name, so that clients can request values by name via an API call. Parameters can also be referenced by index, such as #1, #2, and so forth.

Typical Use Case

In a typical use case, a professor wants to put a link to a tool in a wiki page, so that students can easily start the tool with a specified file name. The HTTP GET request for that case might look something like this:

http://nanohub.org/tools/octaview/invoke/current?params=file%3a%2fdata%2fgroups%2fme581%2fassmt1.txt

Here, params is the parameter string, and there will be only one line in the parameter specification file with file:/data/groups/me581/assmt1.txt. If a tool needs to load 2 files, then the params list should include two file declarations separated by a semicolon the escape sequence %0a%0d (CRLF).

Last modified 10 years ago Last modified on Jan 22, 2014 1:28:03 PM