BasePluginDispatcher       package:aroma.Base       R Documentation

_T_h_e _B_a_s_e_P_l_u_g_i_n_D_i_s_p_a_t_c_h_e_r _c_l_a_s_s

_D_e_s_c_r_i_p_t_i_o_n:

     Package:  aroma.Base 
      *Class BasePluginDispatcher*

     'Object'
      '~~|'
      '~~+--''BasePluginDispatcher'

     *Directly known subclasses:*


     public static class *BasePluginDispatcher*
      extends Object

     See static method 'main()' for help.

_U_s_a_g_e:

     BasePluginDispatcher(...)

_A_r_g_u_m_e_n_t_s:

     ...: Not used.

_F_i_e_l_d_s _a_n_d _M_e_t_h_o_d_s:

     *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

_D_e_f_i_n_i_t_i_o_n_s:

     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.

_R_u_n _t_h_e _p_l_u_g_i_n _d_i_s_p_a_t_c_h_e_r _w_i_t_h_o_u_t _B_A_S_E (_s_t_a_n_d_a_l_o_n_e):

     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

           1.  Create a directory to contain all your plugin
              directories, for example '~/plugins/', if you have not
              done this already,

           2.  Create a plugin directory, e.g. '~/plugins/helloWorld/'.

           3.  Copy 'runBasePluginDispatcher' to the plugin directory.

           4.  Create a 'onRun.R' file that defines the required
              'onRun()' function.

        *  Create a "dummy" working directory

           1.  Create a directory to contain all your working
              directories, for example '~/work/', if you have not done
              this already,

           2.  Create a working directory, e.g. '~/work/12345/'.

           3.  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


        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'.

_A_u_t_h_o_r(_s):

     Henrik Bengtsson (<URL: http://www.braju.com/R/>)

