INSTRUCTIONS TO INSTALL IVA 0.6
===================================

IVA Installation guide

Required software:
Zope	http://www.zope.org
PyXML	http://pyxml.sourceforge.net/
PlacelessTranslationService	http://sourceforge.net/projects/collective/
PIL	http://www.pythonware.com/products/pil/ (with jpeg support)
	jpeg-6b libraries can be found at ftp://ftp.uu.net/graphics/jpeg/	
ZWiki	http://www.zwiki.org (Currently, ZWiki 0.36.2 recommended)
CMF	http://cmf.zope.org (Very optional)

General installation procedure consists of three steps:

See that your system has installed Python (preferrably ver.2.3) and Zope (preferrably ver. 2.7.3).
Install IVA product on your Zope server. 
Install an instance of IVA on your Zope server. 
If you have already Zope installed on your system, skip the step 1 (however, need to check the version compatibility as with Python).

Detailed guidelines for installation:

Step 1. Install Zope and all required software

Download Zope from http://www.zope.org/Products 
Please see zope installation instructions.
Note that IVA works fine without PIL, PyXML and CMF but then some features may give errors or are disabled.
PIL is used in various places all over IVA, PyXML is only for import-export functionality. 

Step 2. Install IVA product
Download the latest IVA tarball at http://www.htk.tpu.ee/iva
Unpack it to a temporary directory - tar xfzv iva-0.6-rc1.tgz 
Move created directories to zope products directory (typically /usr/local/zope/lib/python/Products)
Restart Zope: inside the Zope Management Interface, or ZMI (typically http://localhost:8080/manage), click on Restart button under Control Panel.

Step 3. Install an instance of IVA
Log into Zope Management Interface (typically http://localhost:8080/manage) as manager. 
Create an instance of IVA by selecting IVA from pull-down menu Select type to add... 
Select settings for new IVA instance: 
ID: name to your IVA instance 
Quota: quota for user webtop in bytes (default 3 000 000) 
Lang: default language for all new users 
Add users to your IVA system: 
Go to Management > Course management > Add users. 
Enter the list of usernames and system generates the passwords. If a proposed username already exists on this Zope server, IVA adds a number to it (e.g. john1). 
Create a course: go to Management > Course management and create a new course by clicking on the Add course link. 
Add users to course: Enter the course environment by selecting the name of the course from pull-down menu on your IVA WebTop area. Then go to IVA Management area and click on User Management link in the left menu. Enroll selected users to the course as teachers (or students). Teachers can later add (more) students by themselves. 

Setting up sessions.
--------------------

From IVA 0.7, statistics machinery is changed and is using session to store user actions in IVA.
First statistics is stored in user session. When user logs out or closes browser it's session hangs around
until it times out and then it will be stored. By default Zope will just drop timed out session so you'll
have to set it up.

1. First you'll have to create python script in zope. Add Script (Python) from dropdown menu anywhere you like.
   I'm using this script:
   Bound names: sess,sessContainer
   --- Script start ---
	iva_paths = sess.get('iva_paths', [])
	if iva_paths:
		# it's IVA. otherwise it's something else and should be handled differently
		for x in iva_paths:
			path = x.split('/')
			iva = context
			for y in path:
				if not y:
					continue
				iva = getattr(iva, y)
			iva.Statistics.saveStats(sess.get(x, {}))
   --- Script end ---
   You have to set proxy role to Manager in Proxy tab
   Note that you have to keep indent otherwise it will not work.
   If you already have some session delete script then you'll propably know what to do.
2. In /temp_folder/session_data fill in "Script to call when objects are deleted" box. Put a full path in there.
   From there you can also change the value in minutes in which the session is expired and deleted ( and data populated to IVA )
3. temp_folder and session_data are objects that aren't saved when zope restarts so your settings will also be lost.
   To make settings persistent, put then in zope.conf. 
   Directives session-delete-notify-script-path, session-timeout-minutes, session-resolution-seconds and maximum-number-of-session-objects are then ones you're propably interested in. don't set maximum-number-of-session-objects too low or you'll lose data.
