Sarissa is distributed in two versions. The first is the generic distribution archive that includes the JS files, documentation etc. and can be used by anyone. The second is a Maven artifact that can be used as a dependency for Maven projects. Below you can find more details on how to use both in your project and web pages.

Installation for generic projects

First of all, download the generic distribution from the SF project download page here. After expanding the archive somwhere in your project, then follow the usage instructions at the bottom of this page.

Installation for Maven projects

To use Sarissa as a dependency in your Maven project, add it in your pom.xml file. You will also need to import Maven JSTools for your webapp to build HTTP responses using the Sarissa files:

    <!-- add Sarissa  -->
    <!-- add jstools -->

After that, configure the JavascriptDependencyFilter in your webapp config (i.e. web.xml) to intercept requests for JS files or other static resources packaged in your JS-based dependencies.

Importing the Sarissa scripts in your web pages

To use Sarissa in your web pages, simply import the required files using the script tag, for example:

<script type="text/javascript" 
    src="basePath/gr/abiss/js/sarissa/sarissa.js"> </script>

The available files in the distribution are two (sarissa_dhtml.js has been merged in the main sarissa.js file), plus their compressed versions makiong a total of four files:

  • basePath/gr/abiss/js/sarissa/sarissa.js
  • basePath/gr/abiss/js/sarissa/sarissa_ieemu_xpath.js
  • basePath/gr/abiss/js/sarissa/sarissa-compressed.js
  • basePath/gr/abiss/js/sarissa/sarissa_ieemu_xpath-compressed.js

If you are using the generic distribution, basePath is simply the absolute or relative path to the expanded sarissa distribution directory.

For Maven users however, >basePath should be the same as the value used for JavascriptDependencyFilter's basePath initialization parameter. If you are not familiar with using JS dependencies through Maven, check out the complete tutorial.