Demo startup instructions
From LiquidPubWiki
Contents |
Downloading project code
Project code is made available through our Project Repository.
Building the 'main' application from repository
This way you will get the most updated version available of the application.
Prerequisites
To see it running, you will need:
- A working version of the Java Runtime Environment (>= 1.5).
- Apache Ant (1.7.0 or newer should work), unless you prefer compile, make-war, deploy, etc. manually.
- A working installation of a J2EE Web App container (the build file is targeted at Sun's Glassfish, but it runs also on other servers: we provided some instructions for Apache Tomcat, for other servers, similar steps have to be taken).
Configuring DB connection
Also, a database account to a supported RDBMS is needed: database name, address, username and password parameters used to connect to it must be put in the appropriated place inside web server's configuration file of your installation.
If you are using:
- Glassfish 2.1: just access the Enterprise Server console, and configure a JDBC DataSource in the 'JDBC Resource' subtree, on the navigation tree on the left side of the page (check Glassfish documentation for hints on how to do this). We suggest configuring a Connection Pool instead of a single Connection for performance reasons.
- Tomcat 6.0: you will have to
- locate the "<GlobalNamingResources>" tag inside your installation's "CATALINA_HOME/conf/server.xml", add the following line in it:
<Resource name="jdbc/mockup" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="your_username" password="your_password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/your_db_name?autoReconnect=true"/>
- You will have to supply DB name and a valid username/password pair. Note that, if you want to change the DB, you will also have to change "driverClassName" and (most likely) "url" attributes.
- (Note that this solution doesn't employ a connection pool, you are free to configure one if you want).
- locate the "<Context>" tag inside your installation's "CATALINA_HOME/conf/context.xml", add the following line in it:
<ResourceLink global="jdbc/mockup" name="jdbc/mockup" type="javax.sql.Datasource" />
- Copy chosen DB's JDBC driver in web server's classpath: a copy of MySQL Connector is included in the project, since it's the one we are currently using, you will have to retrieve other ones by yourself.
Database setup
Before starting the application, a database with the right table structure must be created. A SQL script for creating such structure has been included in the code base, and it's currently located at "db/mockup.sql", starting from the project root directory.
However, table structure is fairly trivial so it shouldn't be a big problem to alter said script so that it works for other RDBMS also.
Build instructions
- Checkout the last version of software's code from there. If you use command line svn client, enter this:
svn co https://dev.liquidpub.org/svn/liquidpub/mockup/branches/fullstatic/main/
- at your prompt.
- Move into the project main directory
cd main
- (If you are using Glassfish) Issue this command:
ant deploy-on-glassfish -Dglassfish.admin.password=glassfish_admin_password
- remember to put your actual glassfish admin password, and to set glassfish.home properties to the directory where you installed Glassfish before running this command. You could enter something like this:
export GLASSFISH_HOME=path_to_your_glassfish_installation
- at the command prompt of a *NIX based system, or like this:
set GLASSFISH_HOME=path_to_your_glassfish_installation
- if you are using Windows.
- (If you are not using Glassfish) Invoke ant with the "make-war" target. From a command prompt, issue this:
ant make-war -Dweb.container.home=/path_to_your_web_container_home
- and substitute "path_to_your_web_container_home" with the actual path to your web container application. #:(E. g., if you are using Apache Tomcat on Linux, the path may look like this: /usr/share/tomcat5.5)
- (If you are not using Glassfish) Deploy the war file on your application server: the exact steps to be taken depends on the app server's deployment mechanism, e.g., for tomcat you can use Tomcat manager web app. Please use root deployment context ("/").
And that's all: you should be able to access your new installation by pointing your browser to "localhost:portNumber"; e. g., in a default Glassfish/Tomcat installation:
http://localhost:8080/
