I. Installing backend (GIRI cell)

1. Install R: sudo apt-get install r-base
2. Install package 'xtable' in R:
	sudo R
	install.packages("xtable")
3. Make sure JRI library ( de.erlangen.i2b2.giri/lib/libjri.so ) is compatible with your OS (32 / 64 bit)
	If not: Recompile libjri.so
		a) Open de.erlangen.i2b2.giri/etc/JRI/README and follow compile instructions
		b) Then copy de.erlangen.i2b2.giri/etc/JRI/libjri.so to de.erlangen.i2b2.giri/lib/libjri.so
4. Make an R-Scriptlet root folder wherever you wish und set at least read access for the i2b2 user
5. Edit de.erlangen.i2b2.giri/build.properties (e.g. register R-scriptlet root folder path here)
6. Compile JAVA program with ant:
	cd de.erlangen.i2b2.giri
	ant -f master_build.xml build-all
7. Stop jboss (hot deployment doesn't work with me)
8. Deploy: sudo ant jboss_deploy
9. Start jboss again
10. Check if GIRIService is running (Open browser at http://localhost:9090/i2b2/services/listServices )
11. Insert it into the i2b2 hive:
	- By using the workbench admin tool or
	- Adding an entry to the i2b2 database table I2B2PM.PM_CELL_DATA
		Add line: "GIRI";"/";"GIRI Cell";"REST";"http://localhost:9090/i2b2/rest/GIRIService/";1;null;null;null;"A"
(12. Install more R packages if needed by the scriptlet developer e.g. "survival")




II. Installing frontend (web client plugin)

1. Copy folder GIRI to /var/www/webclient/js-i2b2/cells/
2. Copy folder GIRIPlugin to /var/www/webclient/js-i2b2/cells/plugins
3. Set at least write access rights to i2b2 user for folders: 
	/var/www/webclient/js-i2b2/cells/plugins/GIRIPlugin/assets/csv
	/var/www/webclient/js-i2b2/cells/plugins/GIRIPlugin/assets/plots
	/var/www/webclient/js-i2b2/cells/plugins/GIRIPlugin/assets/RImage
4. Edit /var/www/webclient/js-i2b2/i2b2_loader.js
	Add to i2b2.hive.tempCellsList the following two entries (don't forget the colons at the end!)

		{ code: "GIRI"},

		{ code:	"GIRIPlugin",
		   forceLoading: true,
		   forceConfigMsg: { params: [] },
		   roles: [ "DATA_LDS", "DATA_DEID", "DATA_PROT" ],
		   forceDir: "cells/plugins"
		},
5. An additional entry "GIRI: Statistical functions" should now appear in the plugins list in i2b2




III. Known issues:

- Firefox caches i2b2_loader.js (ans all other .js files) and so it doesn't recognize changes
	-> Type in address of js file ( http://localhost/webclient/js-i2b2/i2b2_loader.js ) and reload (press F5)
- The libs in the common package of this cell are almost the same as in other cells. There's one small difference: the axis2-1.1 lib was replaced by axis2-1.1.1 as the former had a bug causing a MethodNotFoundException