RichFaces 3.3.X SVN Structure Overview

RichFaces SVN Repository. 3.3.x Structure Overview

 


Structure

 

RichFaces repository

has the following directories on the top level:

 

  • cdk - the RichFaces Component Developer Kit

  • docs - the root folder for building the RichFaces Developer's Guide

  • extensions - additional extensions to the main package. Includes extension for gwt, Portal, Seam (not required any more), Trinidad

  • framework - the codebase for RichFaces API and RichFaces Impl libraries

  • samples - the examples that are used for developing and testing RichFaces components

  • sandbox - an incubator for future RichFaces components

  • test-applications - the test suite that the QA team uses to test the components

  • ui - the main project with source code for RichFaces Components

 

ui directory

 

RichFaces is a Maven driven project. Thus, the project structure is based on the approaches provided by Maven.

 

The RichFaces CDK (Component Development Kit) is used for developing RichFaces components. The CDK generates the ready-to-use JSF library based on the source code located in the richfaces directory.

 

The RichFaces project contains several sub-projects. Each subproject is used to develop a particular set of components independent of one another.

 

Some example sub-projects in the ui directory are:

  • dataFilterSlider

  • dataTable

  • drag-drop

  • dropdown-menu

  • gmap

  • etc.

 

Some sub-projects depend on other project(s).  For example, the dropdown-menu sub-project where the rich:dropDownMenu component is developed depends on the menu-components sub-project where rich:menuItem, rich:menuGroup and rich:menuSeparator are developed.

 

During component development, each sub-project is built separately and the resulting jar contains only a developing component (or a set of them).  This jar (small library) is not distributed to the public, but used only for testing purposes.

 

The special sub-project 'assembly' is used to build an integration library that is distributed to the public.

 

samples directory

 

samples contains the source code for main richfaces-demo and test projects

that are used for testing RichFaces components during the development phase.

 

As it is mentioned above, RichFaces components have been developed

separately from each other. This means that the test projects use not the

integration library, but the library that contains only the testing

component(s).

 

How to Build samples Applications

 

Those application are Maven driven. Thus, it's necessary to have a Maven installed

and configured. See "[ How to Configure Maven for

RichFaces|http://labs.jboss.com/wiki/HowToConfigureMavenForRichFaces]" how

to accomplish it.

 

After the Maven is installed and configured, you can launch "mvn install" to

build the example. If you launch this command right at the sample directory,

all available applications are built. The result war file will be located at

the target directory of each project.

 

How to work with  samples Applications in Eclipse

 

This instruction presumes that you use Eclipse and at least the original

WTP 1.5 plugin installed. Red Hat Developers Studio also contains  original

WTP 1.5, so you can use it as well.

 

Preparation:

 

Those steps should be followed once, before you import a first Maven based

project.

 

1. Maven. You need Maven installed and configured, as it is directed above.

 

2. Maven Classpath Variable - M2_REPO. Select "Window->Preferences". In the

Preferences dialog: "Java->Build Path->Classpath Variables". Click

"New....".  Type M2_REPO for name, and choice path the Maven repository.

Click "OK" and close the Preferences dialog.

Note for Maven newbies: Maven repository is not the same that directory

where you installed the Maven files. The default path to it is

~/.m2/repository. You can change the path in the

<Maven-root>/conf/setting.xml file.

 

Import:

 

1. At the root of the project perform the following Maven command:

 

 

 

 

mvn eclipse:eclipse -DdownloadSources=true -Dwtpversion=2.0

 

 

 

 

This magic command creates an eclipse project meta files with WTP support.

Also, it instructs to attach the available source code for each libraries

used in the project. Really cool!

 

2. Launch Eclipse and open the Import Project wizard. Use "Existing Projects

into Workspace" option. Select the root directory of the project and click

Finish.

 

3. On the Server View, right click on the current Server and add the project

to deployment

 

Launch Server (for example, Tomcat) from Server View. Launch a browser and

type the URL to the application. If you can see the application

up-and-running, you have done the import right.

 

Re-import:

 

If you switch to the new version of RichFaces (for example, from

3.3.2-SNAPSHOT to 3.3.3-SNAPSHOT) you need to

re-import the project. Otherwise, it does not see the changes in the

library. In particular situation, re-import

is a good solution when Eclipse starts to produce unexpected glitches.

 

In order to re-import:

 

1. Delete the project from the Eclipse workspace (without deleting the

content)

 

2. At the root of the project perform the following Maven command:

 

 

 

mvn eclipse:clean

 

 

 

 

3. Follow the instruction for the "Import" mentioned above.an