GARDENIA - Gestao Empresarial Author: GOTHAM - Sistemas Integrados de Gestao Empresarial Lda - http://www.gotham.pt License: GNU Lesser General Public License (LGPL) Current Release: 0.9.04 - Duvel Release - Beta Quality Build, for version 1.0.00. Gardenia is a simple to use and effective LGPL J2EE Web based ERP/CRM/Business Management Software, developed for Portuguese SMEs. Manages information about customers, contacts, products, stocks, orders, invoices, credit/debit notes and payments. It has some characteristics of ERP and CRM, but is designed to be simple to use. It was specifically designed for the Portuguese (Portugal) market. Basically manages (create/view/edit) customer/contacts, products, orders, invoices, credit/debit notes, payments, customer issues, etc. Started as a internal project for our own use and to be explored later as a commercial product, we decided to release it using a OSS strategy. It is a J2EE web based software. A Java Web Application (Servlet/JSP) running on Tomcat/Jetty, and uses a RDMS like hsqldb or Firebird. It is largely based on jDbForms (jdbforms.sf.net) framework. Includes reporting and invoice printing (PDF) via JasperReports. Credits: GARDENIA - GESTAO EMPRESARIAL was created by GOTHAM - Sistemas Integrados de Gestao Empresarial Lda. (http://www.gotham.pt), who holds the copyrights for the software. GARDENIA was built using several open source libraries and development frameworks. These are listed bellow, as well as the project links. - JAVA - Java SDK e J2EE - http://java.sun.com - jDbForms - J2EE Web RAD Framework - http://jdbforms.sf.net - JasperReports - Java Reporting Solution - http://jasperreports.sf.net - iReport - JasperReports Design GUI - http://ireport.sf.net - log4j - Java Logging Library - http://logging.apache.org - TOMCAT - Java Web Application Server - http://jakarta.apache.org/tomcat - FireBirdSQL - High Performance SQL Relational Database - http://www.firebirdsql.org - Jetty - Java Web Application Server - http://jetty.mortbay.org - HSQLDB - HyperSonic Java SQL Database - http://hsqldb.sf.net - ThinLet - Java XUL (XML User Interface) Library - http://thinlet.sf.net - IzPack - Installation Package Generator - http://www.izforge.com/izpack/ - IzPack Launcher - Binary (win32) launcher for IzPack - http://www.izforge.com/izpack/ - Roxes Ant Tasks - Usefull Ant Tasks - http://www.roxes.com/produkte/rat.html - ANT - Software Build Tool - http://ant.apache.org - JSTL - Jakarta Default Taglibs - http://jakarta.apache.org - CeWolf - JSP Tags for using JFreeCharts - http://cewolf.sf.net - JFreeChart - Java lib for Charts - http://www.jfree.org - Scriptaculous - JavaScript lib - http://script.aculo.us - Open Rico - JavaScript Lib - http://www.openrico.org - Javascript Calendar - A DHTML/Javascript Calendar - http://www.dynarch.com/projects/calendar/ - Jakarta Velocity - Templating system - http://jakarta.apache.org - iText - PDF Library - http://itext.sf.net Indirectly (mostly due to dependencies of above projects), it includes the following projects: - Jakarta Xerces - http://xml.apache.org - Jakarta Xalan - http://xml.apache.org - Jakarta Commons - http://jakarta.apache.org - Jakarta Maven - http://jakarta.apache.org - Jakarta Cactus - http://jakarta.apache.org - Jakarta ORO - http://jakarta.apache.org - Jakarta POI - http://jakarta.apache.org - Jakarta Batik - http://jakarta.apache.org - HTTP Unit - http://httpunit.sf.net - MaxQ - http://maxq.tigris.org - JUnit - http://junit.sf.net - Neko HTML Parser - http://freshmeat.net/projects/nekohtml - ProtoMatter - http://protomatter.sf.net - Rhino JavaScript Engine - http://www.mozilla.org/rhino/ This is the source code for GARDENIA. It is composed by the following directories: business/ - contains source for business logic java classes for Gardenia model/ - contains source for the OR mapping of Gardenia Database Model (not yet being used :-)) web/ - contains the source for the main web application of Gardenia GUI (jsps, WEB-INF, needed jars, etc) database/ - contains SQL scripts for database creation, and baselines (SQL and Firebird/HSQL binary dumps) common/ - contains mainly libs/jars needed by all modules desktop/ - contains source for creating the desktop edition (gardenia+jetty+hsql+launcher GUI) scripts/ - miscellaneous shell scripts / bat files for gardenia maintainance (backup db, rc.d, etc) dist/ - Contains the GARDENIA final product and installation packages, after the build procedure Building GARDENIA Requirements: - Gardenia (of course). Get it at http://www.gotham.pt or http://gardenia.sf.net - ANT version 1.6.5 (may work with older releases). Get it at http://ant.apache.org - JDK version 1.4.2. Not tested with Java 1.5. Get it at http://java.sun.com - A Human Brain, version 1.0 (may also work with 0.9 through...) :-)) Build Procedure: This system was developed in Java on a Unix system, so the build procedure is only for players of Doom level "Nightmare" :-). No fancy MS VB/VC++/.NET style GUIs with nice and funny icons and making stupid sounds... Just use the good and old command line on a black and green xterm screen and VI. You're warned... :-) Just type "ant clean dist". This will build both the desktop and server editions of GARDENIA. To build only the desktop edition of GARDENIA, type "ant clean dist-desktop-edition" To build only the server edition, type "ant clean dist-server-edition". On file build.properties, if you set the property "installer.winjrepath" to a valid path to a Sun's Java JRE installer, it will be included on gardenia desktop windows installer. The resulting files will be in sub-directory "dist/". These files are: dist/gardenia-enterprise-.zip - enterprise edition of gardenia (zip containing war file, and db scripts) dist/gardenia-desktop--installer.jar - java installer for desktop edition of gardenia (all O.S.) dist/gardenia-desktop--installer-win32.exe - windows installer for desktop edition of gardenia. Installing GARDENIA: a) Installing Gardenia Desktop Edition on a Windows Machine - Just double-click on file gardenia-desktop-installer-win32.exe, and follow the steps of the installation wizard. b) Installing Gardenia Desktop Edition on a Java Enabled O.S. (Linux/Unix/MacOS/Windows): Requirements: - Sun's Java Runtime Environment (JRE) version 1.4.2 or later. Get it at http://java.sun.com - Small Human Brain (yes, a little one will be enought... :-)) Installation Steps: - Just double-click on the file gardenia-desktop-installer.jar. If this does not work, go to the directory where you have the gardenia-desktop-installer.jar file, open a unix shell (or DOS) command line, and type: java -jar gardenia-desktop-installer.jar This will start the installation wizard. Just follow the steps. c) Installing the Gardenia Enterprise Edition (on a Tomcat 4.1.27 web app server). Requirements: - JRE or JDK version 1.4.2 or later (get it at http://java.sun.com) - Tomcat 4.1.27 (supposing it is installed on path /opt/jakarta-tomcat-4.1.27) - FirebirdSQL version 1.5 (or other database, if you want to have some extra work...) - Tomcat webapp deployment knowledge... Installation Steps: 0) Get the installation package for Enterprise edition (gardenia-enterprise-.zip) This file contains: - gardenia.war file - a .war file to be deployed on Tomcat (gardenia.war) - database/ - a directory, containing the SQL scripts to create and populate the database - database/datamodel - subdir, containing the SQL Create Table/Views/Triggers, etc for the DB - database/baseline - subdir with baselines for each language (defaults and config. data SQL insert scripts) - database/binary - subdir with some db backups for several databases. - README.*.txt - some README files with install instructions (this file, probably) 1) Plan your installation, and create your data directories. Gardenia requires a SQL database, and a set of directories for holding data, namely: a) Sell Documents you generate with gardenia (eg, invoices, etc) b) Files you attach to Gardenia Entities (Products, Customer/Suppliers, Issues, etc) c) Depending on database, a directory for holding the database file(s). So, it is recommended that you create a set of directories for that. I suggest "/opt/gardenia/data/document/" for a), and "/opt/gardenia/data/files" for b). For c), it will depend on the database. If you choose the (recomended) FirebirdSQL, http://www.firebirdsql.org, I recommend directory "/opt/gardenia/data/db/". After you choose the directory layout, create these directories: - mkdir /opt/gardenia - mkdir /opt/gardenia/data - mkdir /opt/gardenia/data/db - mkdir /opt/gardenia/data/document - mkdir /opt/gardenia/data/files Also, make sure that the user that runs "Tomcat" is able to read/write to these directories. - chgrp -R "GroupOfTheUserWhoRunsTomcat" /opt/gardenia 2) Create the Database Choose one between methods 2.1, 2.2 or 2.3. Easier is 2.1. 2.1) Create the Database (with Firebird), using an baseline binary backup. Create a new Gardenia database based on the binary backup file, in source code directory "database/binary/". - cd database/binary/ - gbak -create firebird-pt-gardenia01.gbak /opt/gardenia/data/db/gardenia01.gdb -user sysdba -password YourFireBirdSQLSYSDBAPassword - cd ../.. Note: This directory contains several binary dumps for several databases. The file name contains the name of the database, and the language of the baseline data (eg: firebird-pt-gardenia01.gbak is a binary dump for FirebirdSQL with data in Portuguese) 2.2) Create the Database (with Firebird), using the SQL Definition commands. 2.2.1) Create the database in your preferred dir recommended: /opt/gardenia/data/db/gardenia01.gdb - /opt/firebird/bin/isql -u sysdba -p YourFireBirdSQLSYSDBAPassword create database '/opt/gardenia/data/db/gardenia01.gdb'; quit; 2.2.2) Load the FirebirdSQL UDFs into the database: - /opt/firebird/bin/isql -u sysdba -p YourFireBirdSQLSYSDBAPassword /opt/gardenia/data/db/gardenia01.gdb -i /opt/firebird/UDF/fbudf.sql - /opt/firebird/bin/isql -u sysdba -p YourFireBirdSQLSYSDBAPassword /opt/gardenia/data/db/gardenia01.gdb -i /opt/firebird/UDF/ib_udf.sql 2.2.3) Create the datamodel: - cd database/datamodel - /opt/firebird/bin/isql -u sysdba -p YourFireBirdSQLSYSDBAPassword /opt/gardenia/data/db/gardenia01.gdb -i gardenia-create.firebird.sql - cd ../.. 2.2.4) Insert the Baseline for your language (eg, for portuguese) - cd database/baseline - /opt/firebird/bin/isql -u sysdba -p YourFireBirdSQLSYSDBAPassword /opt/gardenia/data/db/gardenia01.gdb -i gardenia-baseline.pt.sql - cd ../.. 2.3) Create the Database, using another database - Create a new file with the SQL Definition for Gardenia Tables. Use as base the files in directory database/datamodel. (ex, gardenia-create.firebird.sql, or gardenia-create.hsql.sql). - Create the tables using your script, and insert the baseline, in directory database/baseline (you may need to adapt it to the specific SQL dialect of your database. - Send your changes to the Gardenia Team, so we can add support for your DB on a next release :-) 3) Put the dist/gardenia.war file in your web app server (tomcat) webapps dir: - cp dist/gardenia.war /opt/jakarta-tomcat-4.1.27/webapps 4) Start tomcat, so it can unpack the gardenia.war file Note: you must have tomcat configured to unpack the war files. Gardenia needs to update some of the config files, in its setup procedure. - /opt/jakarta-tomcat-4.1.27/bin/startup.sh 5) Access the Gardenia Setup page, so you can configure the Database and Data Directories parameters. Access in your browser the URL "http://:/gardenia/setup.jsp". Ex.: http://localhost:8080/gardenia/setup.jsp You will need to configure the following Parameters: DB - JDBC Driver: Self-Explanatory. Ex.: org.firebirdsql.jdbc.FBDriver DB - JDBC URL: Self-Explanatory. Ex.: jdbc:firebirdsql:localhost/3050:/opt/gardenia/data/db/gardenia01.gdb DB - JDBC Username: UserName for DB. Ex.: sysdba DB - JDBC Password: Password for DB. DATA - "GardeniaFilesDataDir": Data directory you choose for Files. Ex.: /opt/gardenia/data/files/ DATA - "DocumentReportDataDir": Data directory you choose for documents. Ex.: /opt/gardenia/data/document/ You probably will not need the following parameters (unless you really know what you're doing): DATA - "DocumentReportDefDir": Directory containing Document Layout Definitions (JasperReports .jasper files) DATA - "GeneralReportDefDir": Directory containing the several gardenia reports definitions (JasperReports .jasper) The setup procedure will change the following files, in directory /opt/jakarta-tomcat-4.1.27/webapps/gardenia: - WEB-INF/dbforms-config.xml - WEB-INF/jetty-web.xml (created based on template WEB-INF/jetty-web.xml.template) - WEB-INF/jetty-realm.properties - META-INF/context.xml (created based on template WEB-INF/context.xml.template) In these files, the ocurrences of the following tokens will be replaced with the values you specified on the setup: __GARDENIA_JDBC_DRIVER__ __GARDENIA_JDBC_URL__ __GARDENIA_JDBC_USER__ __GARDENIA_JDBC_PASS__ __GARDENIA_FILES_DATA_DIR__ The other parameters requested at setup are changed directly on database, on table "tbl_Parameter". If for any reason the setup.jsp fails (ex, you have no permission to write/create these files), you can try change manually these parameters. 5) RESTART tomcat, so these changes can take effect. - /opt/jakarta-tomcat-4.1.27/bin/stop.sh - /opt/jakarta-tomcat-4.1.27/bin/start.sh 6) Access gardenia main page, using the URL http://:/gardenia/. Ex.: http://localhost:8080/gardenia/ You should be presented with the login page. The initial username for administrator user is "admin". Password: "benfica". If you have problems logging in, it may be due to authentication problems. In case you have problems, follow step 6.1): 6.1) In case of problems on step 6): Check authentication parameters in file META-INF/context.xml, or set it up on tomcat's server.xml, in /opt/jakarta-tomcat-4.1.27/conf/server.xml. GARDENIA ships with tomcat user authentication setup on file gardenia/META-INF/context.xml. Check this file for the Database parameters (/opt/jakarta-tomcat-4.1.27/gardenia/META-INF/context.xml). Anyway, if you are using tomcat 4.1.27, it will probably not load automatically, and you will have to Check/Edit the tomcat's server.xml file to include stuff for gardenia authentication (Realm tags on context.xml). Add the following to your /opt/jakarta-tomcat-4.1.27/conf/server.xml (inside your tag, near other similar entries to this one. Check the paths and username/passwords bellow...): If you do this, you will probably need to copy the needed JDBC driver to Tomcat's common/lib dir also: - cp /opt/jakarta-tomcat-4.1.27/webapps/gardenia/WEB-INF/lib/firebird-full.jar /opt/jakarta-tomcat-4.1.27/common/lib After that, restart tomcat. - /opt/jakarta-tomcat-4.1.27/bin/stop.sh - /opt/jakarta-tomcat-4.1.27/bin/start.sh 7) Log-in in GARDENIA with your web browser and check the Admin/Config Parameters - Type the address of GARDENIA in your web browser (probably http://localhost:8080/gardenia/index.jsp ) - Log in. By default, the credentials are: Username: "admin". Password: "benfica". Change it later!!! - Select the option "Administracao", "Parametros Configuracao". Check if the following parameters have the correct paths (note: you can also check/edit the other parameters in this page... :-)) : - DocumentReportDataDir - DocumentReportDefDir - GeneralReportDefDir 8) Enjoy. :-))