%vim:set tw=68:
\documentclass[a4paper,twoside,BCOR19mm]{scrbook}
\usepackage{lastpage}
\usepackage[latin1]{inputenc}
\usepackage{color}
\usepackage{graphicx}
\usepackage{times}
\usepackage{fancyhdr}
\usepackage{natbib}
\usepackage{mdwlist}
\usepackage{Manual}
\usepackage{wasysym}


\def\CVS$#1: #2 ${\expandafter\def\csname CVS#1\endcsname{#2}}
\CVS$Id: svn trunk $

%----------------------------------------------
% Document DATE and VERSION
% set these values when releasing a new version

\newcommand{\documentdate}{19. July, 2011}
\newcommand{\documentversion}{}
\newcommand{\softwareversion}{GREAT-ER 3.0.0}
\newcommand{\documentID}{\CVSId}

\definecolor{stepBackground}{gray}{0.8}

%
% Use this during writing, to make the content visible in xdvi (would be
% a black box otherwise): 
%\renewcommand{\TutorialStep}[1]%
%{
%	\begin{center}
%	\fbox{\parbox{0.95\textwidth}{#1}}
%	\end{center}
%}

\newcommand{\imagescale}{0.6}


\begin{document}

%-----------------------------------
% define header/footer
% The settings here are for single page documents (only odd page set)

% for some pages latex switches back to pagestyle plain :-(
\fancypagestyle{plain}{%
	\fancyhf{} % clear all header and footer fields
	\fancyhead[RO,LE]{\footnotesize \GREATER\ Installation Manual\\ \leftmark}
	\fancyfoot[RO,LE]{\footnotesize Intevation GmbH} % Author
	\fancyfoot[CO,CE]{\footnotesize \thepage/\pageref{LastPage}}
	% set the document title for the footer here!
	\fancyfoot[LO,RE]{\footnotesize \documentdate 
	\\\documentID}
	\renewcommand{\footrulewidth}{0.4pt}
}

% and now define pagestyle fancy
\fancyhead{} % clear all fields
\fancyhead[RO,LE]{\footnotesize \GREATER\ Installation Manual\\ \leftmark}

\fancyfoot{}% clear all fields
\fancyfoot[RO,LE]{\footnotesize Intevation GmbH} % Author
\fancyfoot[CO,CE]{\footnotesize \thepage/\pageref{LastPage}}
% set the document title for the footer here!
\fancyfoot[LO,RE]{\footnotesize \documentdate 
\\\documentID}

\renewcommand{\footrulewidth}{0.4pt}

\pagestyle{fancy}

%-----------------------------------

\parindent0cm

{
	\includegraphics[width=0.3\textwidth]{./intevation-logo.eps}\\[0.1cm]

	 {\tt http://intevation.net}\\[2.0cm] 
}

% reenter the TITLE here
{
	\sffamily\bfseries\Large 
% e.g.:
	GREAT-ER\\[0.5cm]
	\huge GREAT-ER Installation Manual\\[0.5cm]
	\large Geo-referenced Regional Exposure Assessment Tool for European Rivers\\[4cm]
}
\thispagestyle{empty}

\vfill

{\sffamily\small
	Intevation GmbH\\
	Neuer Graben 17\\
	D-49074 Osnabrück\\
	Germany\\
	\\
	Date: \documentdate
}


\newpage

\vfill

This document has been designed with \LaTeX{}.
It is available as source code, PDF- and HTML-format.\\

Version: \documentversion \\
Date: \documentdate \\
Authors: Andre Heinecke

\vfill

Related documents:
\begin{itemize}
\item Thuban Manual, \\Intevation GmbH, 2011
\item GREAT-ER Manual, \\Intevation GmbH, 2011
\item GREAT-ER Administration, \\TechniData AG / Intevation GmbH, 2011
\end{itemize}
\vfill

\vfill

\begin{center}Copyright (c) 2011 Intevation GmbH.\end{center}

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.

\tableofcontents

\chapter{Installation on Windows}
\label{chap:installation_windows}
For the installation of \GREATER\ under Microsoft Windows an installation package
is provided containing all neccessary Data. If you did not recive a copy of this
installer along with this document you can obtain it from the \GREATER\ Homepage.
\footnote{\tt http://www.great-er.org}

To Install \GREATER\ on your system it is reccommended that you execute
the Installer with an administrative account. Or on systems with User
Account Control allow the \GREATER\-Installer to make changes to your
system.

The installation Dialog will ask you where it should install GREATER and
it's components. The default is:
"\textbf{c:\textbackslash Program Files\textbackslash GREAT-ER}" all
Greater Data will be placed into this directory.

\section{Installation Types}
\GREATER\ can be installed in three variants. For a normal single user
installation it is reccomended to use the "Full Installation" which
will install everything that is necessary to use \GREATER\ on the system.

\textit{All installation types Install Python 2.7 which provides the
runtime enviornment for GREAT-ER. If you already have Python 2.7
installed you can disable the installation of this component by
unchecking it in the installation Dialog but this is not
recommended.}

\begin{itemize}
\item Full Installation (\textbf{recommended}) \\
Install the \GREATER\-Desktop client, a
PostgreSQL Database Server the Simulation Models and default catchments.
\item Client Installation \\
Install only the \GREATER\-Desktop client. To
use it for simulations you need to have access to a seperate simulation
Server as well as a seperate Database.
\item Server Installation
Install the Postgres Database for GREAT-ER, with
the default datasets.
\end{itemize}

\newpage
\subsection{Automatic Authentification}
You can use \GREATER\ to automatically authenticate to a database when it
is started. This can be useful for local installations where security
is not an issue. By default the \GREATER\ client will try to connect
to the local database "greater" with username and password "greater".
This is the standard database setup if you have installed the PostgreSQL
database with the \GREATER\ installer.

To change this behaviour you can edit the greater shortcuts and change the
command parameters. The Format for the login information is:

\begin{center}
username/password@<database\_connect\_string> \\
Example: "mpowers/Ietoye8e@192.168.10.50:5423" \\
\end{center}
TODO: Screenshot

\newpage
\section{Server Configuration}
\GREATER\ has two components that can run on a Server as standalone
applications. The database and the simulation models. Both are independent
of each other and also do not need to run on the same System.

\subsection{Configure database for remote connections}
The PostgreSQL \footnote{\tt http://www.postgresql.org} database
coming with \GREATER\ is configured by default to accept only local
connections.
If you want to run it on a dedicated system you have to configure
the database for remote access.
\begin{center}
\emph{Setting up PosgreSQL for remote access opens your system
make sure that you use secure passwords.}
\end{center}

To configure your database it is recommended that you use pgadmin3
which is installed by the \GREATER\ PostgreSQL component.
You can find this application under \textit{<INSTALLDIR>\\postgres9\\bin\\pgAdmin3.exe}
or when Shortcuts were installed in your \GREATER\ Start Menu folder.

When launching pgAdminIII you will see one Server (localhost:5432)
to which you can connect by doubleclicking on its Icon.
The default password for the user \emph{greater} is \textit{greater}.

To change the password to something secure. Use the
\"File->Change Password\" menu option.

To modify the connection settings for your database you can edit the
Server configuration by choosing \"Tools->Server Configuration->pg\_hba.conf\"
and change the field \"IP-Address\" from 127.0.0.1/32 to all.
There are also options to finely configure access rights for just some users
or Databases, please refer to the PostgreSQL Documentation\footnote{\tt 
http://www.postgresql.org/docs/9.0/static} for more information.

TODO: Screenshot

\subsection{Simulation server setup}

TODO:

\newpage
\chapter{Uninstallation}
To uninstall \GREATER\ you can either use the Microsoft Windows Software 
(Programs and Functions on Windows Vista/7) Menu or run the \"Uninstall.exe\"
located in your Installation Directory.


\chapter{Manual Installation}

\section{Dependencies}

\section{Database Setup}

\GREATER\ is implemented in Python and makes use of various Free Software
add-ons to this programming language. See the {\tt\small README} files
of the packages {\sffamily GREAT-ER}, {\sffamily GREAT-ERModel}, 
{\sffamily GREAT-ER-DB}, {\sffamily dagreater} and {\sffamily Thuban} for details. 
In conclusion required are:
\begin{itemize}
	\item Python\footnote{\tt http://www.python.org} 
		(version 2.2.1 or higher)
	\item wxPython\footnote{\tt http://www.wxpython.org} 
		(version 2.4.0 or higher, 
			this implies a wxWindows of the same version)
	\item SQLite\footnote{\tt http://www.hwaci.com/sw/sqlite/} 
		(version 2.8)
	\item SQLite Python bindings\footnote{\tt http://pysqlite.sourceforge.net/} 
		(version 0.4.1)
	\item proj\footnote{\tt http://www.remotesensing.org/proj/} (version 4.4)
	\item Python Numeric Package\footnote{\tt http://numpy.sourceforge.net} 
		(version 23.0)
	\item Python Imaging 
		Library\footnote{\tt http://www.pythonware.com/products/pil/} 
		(PIL, version 1.14)
	\item ReportLab\footnote{\tt http://reportlab.sourceforge.net/} 
		(version 1.17)
	\item Twisted\footnote{\tt http://twistedmatrix.com/} (version 1.0.0)
	\item Oracle 8.x client libraries.
\end{itemize}

\section{Installation without installer package\label{setup}}
\begin{enumerate}
	\item Install Thuban so that the thubaninit module is on 
		Python's module path. One way to do that is to use the 
		{\tt\small python setup.py install\_local} 
		command to build Thuban and to add the directory
   		containing the Thuban sources to the PYTHONPATH 
		environment variable.

	\item Put the packages GREAT-ER-DB, GREAT-ERModel and 
	GREAT-ER into the same directory.

	\item Build GREAT-ER-DB (see {\tt\small GREAT-ER-DB/README} for
			details).
\end{enumerate}

\renewcommand{\documentID}{gnufdl.tex version 1.2}
\include{gnufdl}
\renewcommand{\documentID}{\CVSId}

\label{theverylastpage}
\end{document}


