Install Portal Example Project

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
Tzente s.r.l.

Giovanni Cocco

Update for version 2.0.8 
jAPS Developer
Tzente 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.

2011-03-03

Revision History
Revision 1.62011-03-03MEM

Revisione for the release of jAPS 2.2.0

Revision 1.52010-03-17MEM

Update to version 2.0.10

Revision 1.42009-11-13GC

Update to version 2.0.8

Revision 1.32009-07-23RQ

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 entando (Relative to package jAPS 2.0 entando Portal Example Project). This guide is recommended for technical users who want to customise a portal.


Chapter 1. Scope of the document

Introduction

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

Target audience

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

Prerequisites

In order to take the maximum advantage of 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 entando, you must install on your PC the development environment for jAPS 2.0 entando platform. See the document jAPS2.0 - Instantiate a New Portal - HowTo.

Resources

Additional informations may be obtained through the official mailing-lists:

Is it also possible to refer to the documentation found in the:

jAPS 2.0 entando Project - Developer Website

Chapter 2. What is jAPS2.0

jAPS 2.0 entando is an Open Source, professional "Enterprise Accessible Information Platform" that makes easier aggregation, publishing, access, customization and integration of information, services, processes and resources, complying with accessibility requirements of W3C WCAG standards.

jAPS 2.0 entando Platform provides performance, reliability and scalability features typical of enterprise software (“Enterprise”), allows users with disabilities to access and manage information and services ("Accessible"), seeks to simplify content management ("Information") and it can be used as a framework ("Platform") to build vertical applications based on contents (Content Enabled Vertical Application).

Chapter 3. Configure Portal Example

Configure Portal Example

Introduction

First of all, we need to download the package jAPS 2.0 entando Portal Example Project from SourceForge. Note the the packeages are inside the folder jAPS 2.0 entando PortalExample Project and jAPS2.0_entando-2.2.0-PortalExample-Project. Choose the version that fits your needs; Once donwloaded, choose a temporary location and extract the package.

Basic Configuration

Launch Eclipse and follow the steps below to import the package jAPS 2.0 entando Portal Example Project 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 Portal Example Project 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 PortalExample.

File: buildProperties.xml

From the Project Explorer, browse the project PortalExample 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="PortalExample" />
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: context.xml

Now edit some configuration params for the execution phase. Open the file Java Resources: src,Libraries,WebContent, META-INF,context.xml.

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

Example 3.1. context.xml on Windows

					
	<Environment name="logFilePrefix" 
		value="C:\\workspace\\PortalExample\\build\\temp\\japs_log" 
		type="java.lang.String" override="false" />
	
	<Environment name="resourceDiskRootFolder" 
		value="C:\\workspace\\PortalExample\\WebContent\\resources\\" 
		type="java.lang.String" override="false" />

	<Environment name="protectedResourceDiskRootFolder" 
		value="C:\\workspace\\PortalExample\\WebContent\\protected\\" 
		type="java.lang.String" override="false" />
	
	<Environment name="indexDiskRootFolder" 
		value="C:\\workspace\\PortalExample\\build\\temp\\indexdir" 
		type="java.lang.String" override="false" />
	
	<Environment name="cacheDiskRootFolder" 
		value="C:\\workspace\\PortalExample\\build\\temp\\cache" 
		type="java.lang.String" override="false" />
					
					

Example 3.2. context.xml on Linux

					
	<Environment name="logFilePrefix" 
		value="/home/agile/workspace/PortalExample/build/temp/japs_log" 
		type="java.lang.String" override="false" />
	
	<Environment name="resourceDiskRootFolder" 
		value="/home/agile/workspace/PortalExample/WebContent/resources/" 
		type="java.lang.String" override="false" />

	<Environment name="protectedResourceDiskRootFolder" 
		value="/home/agile/workspace/PortalExample/WebContent/protected/" 
		type="java.lang.String" override="false" />
	
	<Environment name="indexDiskRootFolder" 
		value="/home/agile/workspace/PortalExample/build/temp/indexdir" 
		type="java.lang.String" override="false" />
	
	<Environment name="cacheDiskRootFolder" 
		value="/home/agile/workspace/PortalExample/build/temp/cache" 
		type="java.lang.String" override="false" />
					
					

Create and populate demo databases

jAPS2.0 demo needs two databases, respectively PortalExamplePort and PortalExampleServ.

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

Warning

The following procedure will completely delete the two databases if already present.

You are strongly advised to make a backup of your databases before proceeding.

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

  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 portal example pointing your preferred browser to http://localhost:8080/PortalExample/.

Chapter 4. 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 PortalExampe

  2. Expand the main node and launch (i.e. with a double-click) the War build (create the file PortalExampe.war in the directory workspace\temp\PortalExampe\dist) and War deploy (copy the file PortalExample.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 portal example pointing your preferred browser to http://localhost:8080/PortalExampe/.