Description Usage Arguments Fields and Methods Definitions Run the plugin dispatcher without BASE (standalone) Author(s)
Package: aroma.Base
Class BasePluginDispatcher
Object
~~|
~~+--
BasePluginDispatcher
Directly known subclasses:
public static class BasePluginDispatcher
extends Object
See static method main()
for help.
1 |
... |
Not used. |
Methods:
buildReports | Build reports from RSP templates. | |
main | Static method to start a BASE plugin. | |
patchCode | Sources all R source files in the patch directory. | |
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clone, detach, equals, extend, finalize, gc, getEnvironment, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, objectSize, print, registerFinalizer, save
The plugin directory (path) is the directory where the plugin
source code and the runBasePluginDispatcher
script is located.
Each plugin should have a unique plugin path.
The working directory (path) is the directory in which the plugin is evaluated by BASE. Contrary to the plugin directory, it is not possible to know the path to the working directory on before hand.
While developing a plugin for BASE, it is possible to test the plugin by running it on a local machine without BASE. To do this, prepare the following:
Create plugin directory
Create a directory to contain all your plugin directories,
for example ~/plugins/
, if you have not done this already,
Create a plugin directory, e.g. ~/plugins/helloWorld/
.
Copy runBasePluginDispatcher
to the plugin directory.
Create a onRun.R
file that defines the required onRun()
function.
Create a "dummy" working directory
Create a directory to contain all your working directories,
for example ~/work/
, if you have not done this already,
Create a working directory, e.g. ~/work/12345/
.
The data sent from BASE to the plugin is available in file
stdin.txt
in the working directory.
(You can "keep" such data by selecting "Leave stdout" in the
plugin settings page.)
Next is to run the plugin. Start R in the working directory you created
above, alternatively, use setwd("~/work/12345/")
to change it in R.
Then, in R, do
1 2 3 | library(aroma.Base)
BasePluginDispatcher$main(pluginPath="~/plugins/helloWorld/")
|
This will load all *.R
files in the plugin path, read BASE
data from file .inputData.base
, call onParameters()
as soon
as the plugin parameters section is read, update parameters accordingly,
continue to read the rest of the data file and wrap the data up in a
BaseFile
object, then call then onRun()
function.
Any output written by the plugin (to standard output of standard error)
will be outputted to standard error, that is, in the example, the output
will be seen on the screen, cf. when running on a BASE server such output
will end up under "Plug-in output".
if valid BASE data object are returned by onRun()
, they are
automatically written to a BASE file named .outputData.base
.
Henrik Bengtsson (http://www.braju.com/R/)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.