BSF Integration BSF Installation BSF in XSP

Core BSF

As a first step core BSF must be installed. This was down downloading the following jar files:

These jar files must be stored in the [vodoo-home]/lib/bsf directory.

Languages and BSF

Adding a language is simply done. First at all the language support (a jar file in general) must be downloaded in the Web and stored in the [vodoo-home]/lib/bsf directory. Then enabling this language is just done declaring its existance in the framework in the file language.xml. Such declaration was done giving a name for the language (using in the script tag later), the java library and an optional block for XSP context definition and extraction used to retrieve the initial variable providing the rule context.

BSF Configuration file

Such configuration defines first basic archives for BSF like bsf.jar and apache logging module. Second step consist in defining a given entry for each user required language. Such entry provides archives require archives, engine definition if mandatory and probably dedicated environment variables.


 <BSFConfiguration base='$(vodoo-stream.home)/lib/bsf/'>

  <!-- Apache loggin facilities used by BSF -->
  <Archive href='commons-logging-1.1.jar'/>

  <!-- Initial libraries for BSF support -->
  <Archive href='bsf.jar'/>

  <Language name='javascript'>
   <Archive href='languages/js.jar'/>
   <CodeHeader>
      var CTX = bfs.lookupBean("CTX");
   </CodeHeader>
  </Language>

  <Language name='beanshell'>
   <Archive href='languages/bsh-bsf-2.0b4.jar'/>
   <Archive href='languages/bsh-core-2.0b4.jar'/>
   <CodeHeader>
      CTX = bfs.lookupBean("CTX");
   </CodeHeader>
  </Language>

  <Language name='ruby'>
   <Property name='jruby.home' value='Ruby Home'/>
   <Property name='jruby.base' value='Ruby Base'/>
   <Engine mimes='rb' class='org.jruby.javasupport.bsf.JRubyEngine'/>
   <Archive href='languages/jruby.jar'> Jar for JRuby</Archive>
  </Language>

 </BSFConfiguration>
        
BSF configuration [site-xsp/bsf/languages.xml]