-*- mode: org; -*-

#######################################################################
#  This file is part of GNOWSYS: Gnowledge Networking and
#  Organizing System.
#
#  GNOWSYS is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as
#  published by the Free Software Foundation; either version 3 of
#  the License, or (at your option) any later version.
#
#  GNOWSYS is distributed in the hope that it will be useful, but
#  WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public
#  License along with GNOWSYS (COPYING); if not, write to the
#  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
#  Boston, MA  02110-1301  USA59 Temple Place, Suite 330,
#
######################################################################



#+TITLE:       GNOWSYS Installation Instructions
#+AUTHOR:      Rajiv Nair
#+EMAIL:       rajivnair@gnu.org
#+OPTIONS:     ^:nil


* Operating systems
  GNOWSYS has been tested on Ubuntu and Debian. 
  It would be great if you are using any one of \\
  the operating system mentioned. If any other 
  operating system is being used please let us know \\
  the errors you get while installation


* Dependencies

- gcc 
- postgresql-8.3
- libpq-dev
- python2.4-dev
- postgresql-plpython-8.3



* Plone download and installation

  1.  Checkout the latest version of Plone from http://plone.org/products/plone. 
      Click on the link "Download Plone for Linux/BSD/Unix".

  2.  abc@gnowledge:~$ sudo tar -zxvf Plone-3.2.1r4-UnifiedInstaller.tgz 

  3.  abc@gnowledge:~$ cd Plone-3.2.1r4-UnifiedInstaller

  4.  Read the README.txt file for installation instructions.


* Plone Products

** LocalFS
  
  Download LocalFS product from: http://www.easyleading.org/Downloads/LocalFS-1.7rc1-andreas.tar.gz. \\
  LocalFS should be unpacked and put in the `Products` folder. One needs to restart Zope for it to work. \\
  We use LocalFS to access filesystem at the CLIENT_HOME. \\
  Note: You need to change an import statement on line number 52 of the LocalFS.py file in \\
  the LocalFS folder. Replace the line "from OFS.content_types import find_binary" to \\
  "from zope.app.content_types import find_binary"


** SQLPASPlugin

  You can obtain this from http://plone.org/products/sqlpasplugin \\
  This plugin stores all the user details in postgresql and is an extension to \\ 
  the Plone/Zope authentication. SQLPASPlugin is a Plone Archetype product. \\
  Copy the folder 'SQLPASPlugin' in the Products folder



* Zope Relational Database Adapter 
 
  1.  Download psycopg2-2.0.9.tgz from the  http://initd.org/pub/software/psycopg.

  2.  abc@gnowledge:~$ sudo tar -zxvf psycopg2-2.0.9.tgz. 

  3.  abc@gnowledge:~$ cd psycopg2-2.0.9 
      
  4.  abc@gnowledge:~$ sudo PLONE_PYTHON_PATH setup.py build  
      
  5.  abc@gnowledge:~$ sudo PLONE_PYTHON_PATH setup.py install \\
      For example: PLONE_PYTHON_PATH = /opt/plone/Python-2.4/bin/python 

  6.  abc@gnowledge:~$ sudo cp - R ZPsycopgDA INSTANCE_HOME/Products. \\
      INSTANCE_HOME is the directory were your Products folder would be. \\ 
      To check what your INSTANCE_HOME is please enter the  ZMI and click \\
      on Control Panel 


* GNOWSYS Installation

** User creation in postgres

  1. abc@gnowledge:~$ sudo su postgres
    
  2. postgres@gnowledge:~$ psql

  3. postgres=# create user gnowsys with superuser password 'gnowsys'

** Generating GnowsysSchema

  1. abc@gnowledge:~$ svn co svn://svn.sv.gnu.org/gnowsys/gnowsysApp_rc1
                               
  2. abc@gnowledge:~$ cd gnowsysApp_rc1/ \\
     
  3. abc@gnowledge:~gnowsysApp_rc1$ sudo chown plone.root inituser.txt \\

  4. abc@gnowledge:~$ cd gnowsysApp_rc1/GBStorage/ \\
     
  5. abc@gnowledge:~gnowsysApp_rc1/GBStorage$ sudo python Install.py \\
     DATABASE: gnowsysdb  ( name of the database) \\
     USERNAME: gnowsys    ( postgres user username ) \\
     PASSWORD: gnowsys    ( postgres user password ) \\
     HOST: localhost

** Installing GNOWSYS as a Plone Product

  1. Copy the gnowsysApp_rc1 folder to the Products directory of your Plone.

  2. Restart Zope
   
  3. Visit Zope management Interface using a browser, say firefox \\
     depending on which port the Zope is currently running. Usually \\
     it is [http://localhost:8080/manage] 

     [[file:../images/zmi.png]]

   
  4. Add a "Plone Site" from the add product menu. The name of the \\
     Plone site can be your choice, say 'gnowsys'
 
  5. From the portal_quickinstaller within the plone-site install \\ 
     gnowsysApp_rc1,SQLPASPlugin. 

     [[file:../images/quickinstaller.png]]

  6. If the name of the Plone Site is given as 'gnowsys', then view \\
     the site from [http://localhost:8080/gnowsys]
 


* Configuring SQLPASPlugin for authentication

- Click on "Site Setup" after viewing the site

- In the Preferences menu, notice the 'Add on Product
  Configuration' items, select 'SQL Authentication'.

- Choose the adapter 'dbadapter' and click 'apply changes'.

  [[file:../images/adapter.png]]

- Change the field value 'name of the user table' from 'users to
  auth_schema.users', and apply changes.

  [[file:../images/users.png]]

- Visit the 'acl_users' object from the Plone instance. You will
  see three SQL objects in the acl_users's folder. 

- Click on the  'source_properties' and then on 'properties`'. Change 
  the 'Column Mapping Field' values, and add two lines as follows and 
  save changes.

  fullname/fullname  \\
  email/email
           
  [[file:../images/properties.png]]

- Then from the acl_users folder, click on 'source_roles' and then on 'properties'. Change the value of 
  'roles_table' to 'auth_schema.roles' and save changes.

  [[file:../images/roles.png]]

- Then from the acl_users folder, click on 'source_users' and
  then on 'properties'.Change the value of 'default_encryption' 
  to 'md5' and save changes.

  [[file:../images/md5.png]]



* Mailing list 
  
  Subscription Page: http://gnowledge.org/cgi-bin/mailman/listinfo/gnowsys-dev \\
  To post to the list send a mail to gnowsys-dev@gnowledge.org


* Usage Examples

  For examples refer the EXAMPLES.txt file in the same directory. \\
  It's advisable to use gnowsys-mode to work with GNOWSYS. For more \\
  information on gnowsys-mode visit http://www.gnu.org/software/gnowsys/gnowsysmode.html.









