Installation and Configuration for SBFC online

Requirements
To follow these directions you will need the following tools:
 * Eclipse with the Plug-in Development Environment (PDE) included. As indicated here, the PDE comes with the Classic, Java EE or RCP/Plugin versions of eclipse.
 * MySQL database.
 * Tomcat version 5.5.
 * A tool for checking out a repository from subversion (e.g. subclipse for Eclipse, Tortoise for Windows, or the typical SVN command line client for Linux and Mac OSX).

Set up for SBFC Online (Web server)
This section explains how to set up and configure SBFC Online, MySQL (see http://www.mysql.com/), Tomcat (see http://tomcat.apache.org/) and Ant (see http://ant.apache.org/).

Check out source code
As reference, SBFC_Online will be the directory containing the project to check out. Go into the directory where you want to check out the project.

a) Command line check out with SVN:  svn checkout svn://svn.code.sf.net/p/sbfc/code/sbfcOnline SBFC_Online

b) Eclipse. Check out source code with subclipse SVN (see http://subclipse.tigris.org):  File -> Import -> SVN -> Checkout Projects with SVN    URL= svn://svn.code.sf.net/p/sbfc/code/sbfcOnline   Create new Java Project -> Save the project as SBFC_Online -> Finish

After checking out the project, you will need reference the SBFC_Online libraries to the Java Build Path. In Eclipse: Package Explorer -> SBFC_Online -> Properties -> Java Build Path -> Add JARs Expand SBFC_Online -> Expand lib. Select all the jar files in lib -> OK.

Install and configure MySQL
a) Linux users:  Install MySQL from the repository of your Linux distribution. b) Windows users: Download and install MySQL from http://dev.mysql.com/downloads/windows/

After installing MySQL, you have to source the file converters.sql inside the folder db/. Assuming you use the user root:

cd SBFC_Online/db mysql -u root # and from MySQL command line, type: create database converters; connect converters; source converters.sql; # you should see the tables now: show tables; # you should see the new database now: show databases; exit;

Finally, you have to link SBFC_Online to the imported database. To do this you need to edit the field url in the configuration file context.xml: # File: SBFC_Online/WebContent/META-INF/context.xml url="jdbc:mysql://localhost/converters?autoReconnect=true"

If you want to specify a specific non-root user with read/write access to the database, you also have to edit the lines: username="root" password=""

If you use another database instead of MySQL, you also have to edit the lines: name="jdbc/mydb" driverClassName="com.mysql.jdbc.Driver"

Install and configure Tomcat
SBFC Online requires Tomcat v. 5.5 to run correctly.

a) Linux users:  Install tomcat from the repository of your Linux distribution. b) Windows users: Download and install Tomcat from http://tomcat.apache.org/

After installing Tomcat, you need to reference the jar file mail.jar to the Java Build Path for SBFC_Online. In Eclipse: Package Explorer -> SBFC_Online -> Properties -> Java Build Path -> Add External JARs Search for APACHE-TOMCAT_FOLDER/common/lib/ Select the file mail.jar -> OK.

Then, add admin and manager permissions to the user tomcat: # File: apache-tomcat-5.5.36/conf/tomcat-users.xml 

You will need to created the nested folder WWW/onlineConvert: # If you want these folders to be located in your $HOME, then: cd $HOME mkdir -p WWW/onlineConvert

And then configure SBFC_Online with your parameters. To do this you need to edit the field value in the configuration file context.xml accordingly with your paths. In particular, you will have to replace $HOME with the path where the folder WWW/onlineConverter was created in the previous step, and ${SBFC_FOLDER} with the path where SBFC_core is located. # File: SBFC_Online/WebContent/META-INF/context.xml        Finally, start tomcat by typing catalina.sh from a shell.

Test: start your web browser and visit the page http://localhost:8080/manager/html.

Set up and configure SBFC Online with Ant
Before proceeding, make sure that your Tomcat is running properly. In the folder SBFC_Online, you need to edit the deploy.url property name in the file build.xml'':



in order to use your localhost.

a) Eclipse:  (Set up)   Package Explorer window -> open the project SBFC_Online;   Select build.xml -> Run As -> External Tools Configurations;   In the window corresponding to SBFC_Online build.xml, select tomcat.deploy in the tab Targets.   (Run)   Package Explorer window  -> open the project SBFC_Online;   Select build.xml -> Run As -> Ant Build. b) Run using command line: cd SBFC_Online ant tomcat.deploy

Test (Tomcat and MySQL must be running): start your web browser and visit the page http://localhost:8080/converters/.

If ant tomcat.deploy does not work, you can run ant package to generate the war file.