Run an Analytic

DESCRIPTION:

Executes an analytic with a given URL name.

USAGE:

spserver.analytic.run(analytic.name, ...)

REQUIRED ARGUMENTS:

analytic.name
WebDAV URL of the directory containing the analytic script file. This can be a relative URL, in which case it is resolved relative to the URL specified by the system "splus.analytics.url" property.

OPTIONAL ARGUMENTS:

...
Other arguments that will be passed to the analytic function. These arguments can be named.

VALUE:

The value returned by the analytic function.

DETAILS:

This function sets the current analytic name to analytic.name, reads the associated script file, and then executes the associated analytics function. All of these have names derived from analytic.name. For example, if the analytic name was http://server1:8080/SplusServer/webdav/analytics/xyz, then it would search for a script file in the specified directory with the name xyz.q, xyz.ssc, or xyz.S (searched in this order), and then execute the function xyz.

This function can be called while executing one analytic, to run another analytic. After the "inner" analytic is run, the analytic name is reset to the outer one.

No cleanup is done after an analytic is run, to remove the function definitions from the analytic script file.

EXAMPLES:

# run the analytic named "foo" in the "splus.analytics.url" directory
# spserver.analytic.run("foo")
# run an analytic whose name is given by a complete URL
# spserver.analytic.run("http://server1:8080/SplusServer/webdav/analytics/foo")