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.
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.
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:
<dependencies> <!-- add Sarissa --> <dependency> <groupId>gr.abiss.js</groupId> <artifactId>sarissa</artifactId> <version>LATEST_VERSION_HERE</version> </dependency> <!-- add jstools --> <dependency> <groupId>gr.abiss.mvn.plugins</groupId> <artifactId>maven-jstools-plugin</artifactId> <version>LATEST_VERSION_HERE</version> </dependency> </dependencies>
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.
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:
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.