Install Demo

Do It The jAPS Way

Eugenio Santoboni

First and complete version in Italian 
Chief Solution Engineer
AgileTec s.r.l.

Roberta Quaresima

Porting to DocBook 4.5 and translation to English 
jAPS Chief Marketing Officier
AgileTec s.r.l.

Legal Notice

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 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 Appendix entitled "GNU Free Documentation License".

The copyright holders make no representation about the suitability of this Document for any purpose. It is provided “as is” without expressed or implied warranty. If you modify this Document in any way, identify your resulting Document as a variant of this Document.

2009-06-01

Revision History
Revision 1.32009-06-01RQ

English and docbook adoption

Revision 1.22009-02-09ES

Public release

Abstract

This document describes how to install the portal example built with jAPS 2.0 (Relative to package jAPS demo). This guide is recommended for technical users who want to customize a portal.


Chapter 1. Scope of the document

Introduction

This document describes how to install the portal example built with jAPS 2.0 (Relative to package jAPS demo). This guide is recommended for technical users who want to customize a portal. Using demo, users have the opportunity to try services and features of jAPS 2.0 platform.

Target audience

This document is for developers aiming to customize a portal beginning from a portal example buitl with jAPS 2.0.

Prerequisites

In order to take maximum advantage from the present document, it is necessary to have basic knowledge about: the Java platform, the Eclipse IDE, the Apache Tomcat servlet engine, the PosgreSQL DBMS.

To install the portal example built with jAPS 2.0, you must install on your PC the development environment for jAPS 2.0 platform. See the document jAPS2.0 - Instantiate a New Portal - HowTo.

Resources

Additional informations may be obtained through the following two mailing-lists:

Chapter 2. Configure Demo Portal

Configure Demo Portal

Introduction

First of all, we need to download the package jAPS2.0_2.0.4_demo from SourceForge. Once donwloaded, choose a temporary location and extract the package.

Basic Configuration

Launch Eclipse and take the following steps in order to import the package jAPS2.0-2.0.4-demo in the workspace:

  1. File, then Import...

  2. Choose General, then Existing Projects into Workspace, and press the Next button

  3. Browse and select the directory from which import the project. Obviously, the right directory is the temporary one where you previously extracted the jAPS2.0-2.0.4-demo package downloaded from SourceForge

  4. Check the Copy projects into workspace box

  5. Press Finish

When Eclipse finishes to import, in the Project Explore view of Eclipse will be a new project called jAPS2-demo.

File: buildProperties.xml

From the Project Explorer, browse the project jAPS2-demo and open the file buildProperties.xml. located in the root directory of the project. First of all properly comment or uncomment the blocks of properties suited for Microsoft Windows or Linux, following the XML syntax for comments:

					
<!-- This sentence is commented out  -->
					
				

I.e. if you are using Windows, you have to comment out the Linux block and uncomment the Windows one. And so on...

Then edit the following properties accordingly with your system settings:

Name of the web application, the same as the name of the project
<property name="webappname" value="jAPS2-demo" />
Username for the Database
<property name="postgres.username" value="agile" />
Password for the Database
<property name="postgres.password" value="agile" />
Path of the PostgreSQL executables

Windows: <property name="postgres.bin.path" location="C:\Programmi\PostgreSQL\8.3\bin" />

Linux: <property name="postgres.bin.path" location="/usr/bin" />

File: systemParams.properties

Now edit some properties for the execution phase. Open the file Java Resources: src,Libraries,WebContent, WEB-INF,conf,systemParams.properties.

Edit the paths in the following properties, adapting the part which specifies the directory of the workspace.

Example 2.1. systemParams.properties on Windows

					
logFilePrefix=C:\\workspace\\jAPS2-demo\\build\\temp\\japs_log
resourceDiskRootFolder=C:\\workspace\\jAPS2-demo\\WebContent\\resources\\
protectedResourceDiskRootFolder=C:\\workspace\\jAPS2-demo\\WebContent\\protected\\
indexDiskRootFolder=C:\\workspace\\jAPS2-demo\\build\\temp\\indexdir
					
					

Example 2.2. systemParams.properties on Linux

					
logFilePrefix=/home/workspace/jAPS2-demo/build/temp/japs_log
resourceDiskRootFolder=/home/workspace/jAPS2-demo/WebContent/resources/
protectedResourceDiskRootFolder=/home/workspace/jAPS2-demo/WebContent/protected/
indexDiskRootFolder=/home/workspace/jAPS2-demo/build/temp/indexdir
					
					

Create and populate demo databases

jAPS2.0 demo needs two databases, respectively jAPS2-demoPort and jAPS2-demoServ.

Ant can automagically create and populate the two databases for you:

Warning

The next procedure completely deletes the two databases if already present.

Please consider doing a backup before proceeding further.

  1. Drag the file build.xml and drop it in the Ant view (it will be then listed with the name jAPS2-demo

  2. Expand the main node and launch (i.e. with a double-click) the Pg db full update task

Configure the execution server

Because demo is a Dynamic Web Project, now you can configure the server for the execution of the web application during the development.

  1. Choose File, New, Other, Server to launch the wizard

  2. Select Apache - Tomcat v6.0 server, then press the Next button

  3. In the window Tomcat Server set the Tomcat installation directory (i.e. the directory where you installed Apache Tomcat in [Chapter 3. Software Requirements]), the press the Next button again

  4. Add myportal to the list of projects configured on this server, then press the Finish button

If everything works fine, Eclipse compiles and deploys the web application in a directory of its own (which we are not interested in knowing at the moment). From now on, you can launch the web application with right mouse button on the project then choosing Run As..., Run on Server.

If a server selection window appears, select the server you just created. You can also get rid of this window checking the Always use this server when running this project setting.

If everything is ok, you can see the homepage of your demo portal pointing your preferred browser to http://localhost:8080/jAPS2-demo/.

Chapter 3. Configuration for system administrator

Configuration for system administrator

Introduction

In this chapter we describe the guidelines for an alternative configuration of demo portal for system administrator.

First of all, we need to follow the steps describe in the paragraphs

  • Basic Configuration
  • File: buildProperties.xml
  • Create and populate demo databases.

Then, follow the guidelines describe in the next paragraphs.

Add configuration in file: buildProperties.xml

Edit the file buildProperties.xml located in the root directory of the project. It is necessary to modify the parameters according to the server used.

					
<!-- This sentence is commented out  -->
					
				

I.e. if you are using Windows, you have to comment out the Linux block and uncomment the Windows one. And so on...

Then edit the following properties accordingly with your system settings for Tomcat path:

  • <property name="tomcat.home.path" value="C:\\tomcat6" />
  • <property name="logPrefixPath" value="${tomcat.home. path}\\logs\\${webappname}_log" />
  • <property name="cacheDiskRootFolder" value="${tomcat. home.path}\\webapps\\${webappname}\\cache" />
  • <property name="resourceDiskRootFolder" value="${tomc at.home.path}\\webapps\\${webappname}\\resources" />
  • <property name="protectedResourceDiskRootFolder" value ="${tomcat.home.path}\\webapps\\${webappname}\\protected" />
  • <property name="indexDiskRootFolder" value="${tomcat. home.path}\\webapps\\${webappname}\\indexdir" />
  • <property name="cachePropertiesFilePath" value="\\WEB-INF\\conf\\oscache.properties" />

Create the .War packages

Ant can automatically create the .War package

  1. Drag the file build.xml and drop it in the Ant view (it will be then listed with the name jAPS2-demo

  2. Expand the main node and launch (i.e. with a double-click) the War build (create the file jAPS2-demo.war in the directory workspace\temp\jAPS2-demo\dist) and War deploy (copy the file jAPS2-demo.war in Tomcat webapps) tasks

If everything works fine, you can launch the web application starting Tomcat.

If everything is ok, you can see the homepage of your demo portal pointing your preferred browser to http://localhost:8080/jAPS2-demo/.