Navigation


RSS:News


2008 Copyright jGuild International Ltd

Overview

DevPortal is a web portal targeted for organizations that develop software

  1. It acts as a central point for all information regarding the organization projects, as well as the support infrastructure that is available within the organization.

  2. It provides various tools and infrastructure to improve the productivity of all those working on IT projects within the organization.

  3. It integrates with various mainstream tools and development infrastructure, in order to provide various benefits like automation of infrastructure setup, or providing integration between various tools which don’t normally provide it out of the box.

The features currently provided are:

  • Setup of project infrastructure ( SVN, Hudson )

  • Creation of source skeleton which is checked in the version control when a project is created. Custom templates can be created for that purpose.

Installation

Using installer

In the 1.0 release DevPortal will include an installer to allow to easily configure it, however until that time configuration must be done manually.

Manual

In order to configure DevPortal for your environment, you need to first extract the appropriate devportal.war file (which can be done with any tool that support unzipping, since a .war file is in reality a .zip file) . Once that is done, you will find all the relevant configuration files under WEB-INF/config.

DevPortal can be deployed on any servlet 2.5 or 2.4 compliant container. Please note that in order to run it on a 2.4 container, you will need to insert all the jar files located in the 'servlet-24-compat' folder from the distribution zip file, into the WEB-INF/lib directory located inside the war file.

Database

The first step is to configure the database. In order to do that, you will need to edit the devportal.properties file that is under WEB-INF/config, and set the values to point to your database

  • db.driver: This must indicate the name of the driver class that your database uses

  • db.url: This must contain a jdbc URL to your database.

  • db.username: Username used to connect to the database

  • db.password: Password used to connect to the database

  • db.dialect: Hibernate dialect for your database. You can find the list of dialect in the hibernate documentation website

After you've configured all the database settings, you will need to add the appropriate jar files for your jdbc drivers to WEB-INF/lib

Security

By default DevPortal is configured to leverage the security infrastructure provided by the servlet container. Please refer to your servlet container's documentation on how to set it up.

As indicated in the WEB-INF/web.xml file, mappings for the role 'admin' and 'user' must be created.

Source Templates

DevPortal can retrieve project templates either through a URL which points to a zipped file containing the templates, or in a subversion repository.

A source template will contain any number of file, which may be transformed with the FreeMarker template engine.

The first step of creating a template, is to create a stindex.ftl file. This file follows the structure of a java property file , but will be processed with FreeMarker before being loaded (more details on this below).

The stindex.ftl contain key/value pairs, with keys being representative of the location of the file in the template, and the value representing the path of the file in the version control repository. Parent directories are automatically created.

In order to create a template file that will be processed with the freemarker templating engine, the file must end in '.ftl'

Finally, in order to create empty directories, you need to put in both the 'key' and 'value' the path of the directory to be created in the version control repository. This must naturally not match with any existing files in the source template.

stindex.ftl example: A build.ftl file to be processed with FreeMarker engine, and the result stored under build.xml

build.ftl=build.xml

stindex.ftl example: A web/build.ftl file that should be processed with FreeMarker engine, and the result stored under src/web/WEB-INF/web.xml

web/build.ftl=src/web/WEB-INF/web.xml

stindex.ftl example: A images/logo.gif file should be copied as-is to src/web/logo.gif

images/logo.gif=src/web/logo.gif

stindex.ftl example: A src/java directory should be created in the version control repository

src/java=src/java

FreeMarker template processing

Introduction

All source template files that end with '.ftl' are processed with the FreeMarker. This means that by inserting special annotations in the file, it is possible to insert data from the project, like the project name, or code.

When the file is processed, a number of data model attributes are introduced in the template, as described in the freemarker documentation .

Data Model Attributes

  • module: This model attributes corresponds to the java class 'com.jguild.devportal.project.Module', which contains all information related to the module the template is being created for. This is very commonly used to retrieve the project's full name or code, using ${module.name} or ${module.code}, respectively. Please note that in the current version, the concept of modules is hidden, and every project has a single module with the same properties as the project.

Example freemarker template file: Ant build script - build.ftl

<project name="${module.parent.name}: ${module.name}" default="classes">
    <property name="build.dir" value="_build/"/>
    <property name="deps.dir" value="resources/lib"/>
    <property name="version" value="snapshot"/>

    <path id="classpath.all">
        <fileset dir="${r"${dest.dir}"}" includes="**/*.jar"/>
    </path>

    <target name="clean">
        <delete dir='${r"${build.dir}"}'/>
    </target>

    <target name="classes">
        <mkdir dir="${r"${build.dir}"}/classes"/>
        <javac destdir="${r"${build.dir}"}/classes" srcdir="src/java" classpathref="classpath.all"/>
    </target>

    <target name="jar">
        <jar destfile="${r"${build.dir}"}/${module.id}-${r"${version}"}.jar"/>
    </target>
</project>

In this example, the name of the project followed by the module's name is inserted as the ant project name attribute, using${module.parent.name}: ${module.name}.

The module's id is also inserted in the jar target, so that the created jar file has the same name, using${module.id}.

Finally, please note that ant's properties clash with FreeMarker, so rather that using ${build.dir} to access the build.dir ant property, we've replaced it with ${r"${build.dir}"}, which is then in turn transformed back into ${build.dir} After template processing.

Links