Chapter 3. Application Overview
Keywords: RichFaces

### Create new RichFaces Documentation Jira issue

Summary
255 characters left
Description
Environment
This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.org Community Documentation

- Prev
- Next

## Chapter 3. Application Overview

expand all

## 3.1. Page flows

expand all

The page flow of the application is illustrated in the diagram.

Figure 3.1. Page Flow diagram

### 3.1.1. Page flows: implementation details

expand all

This section covers how the particular elements that govern page flow are implemented in the application.

#### 3.1.1.1. Registering

Registering in is basically the first step a user takes in the application if he/she wants to have access to all features of the application. Have a look at a piece of code from `\includes\index\index.xhtml`:

    ...

    <h:panelGroup rendered="#{!identity.loggedIn}"  styleClass="top-right-bottom-menu-item-link" layout="block">

      <h:form style="margin: 0px">

        <a4j:commandLink value="#{messages['login.register']}"actionListener="#{authenticator.goToRegister}" reRender="mainArea" />

      </h:form>

    </h:panelGroup>

    ...

When the button is hit the `goToRegister` method of the `Authenticator` class is invoked and the `START_REGISTER_EVENT` is raised. These action display the registration form that is included from `\includes\register.xhtml`.

The <a4j:commandLink> displays the link to the registration form and invokes the `goToRegister` method.

When all fields are filled out with correct values the `authenticator.register(user)` is triggered and a new user object is declared.

#### 3.1.1.2. Navigation Between Pages

Technically, user does not browse between pages of the application: every content page is included into the content area of `index.xhtml` file after a certain action performed by user.

    ...

    <h:panelGroup styleClass="content_box" layout="block">

      <ui:include src="#{model.mainArea.template}" />

    </h:panelGroup>

    ...

Figure 3.2. Content Area

The `NavigationEnum` enumeration encapsulated all possible states, that can be applied to content area ("mainArea") on the page.

    ...

     public enum NavigationEnum {

        ANONYM("includes/publicShelves.xhtml"),

        FILE_UPLOAD("includes/fileUpload.xhtml"),

        USER_PREFS("includes/userPrefs.xhtml"),

        REGISTER("includes/register.xhtml"),

        SEARCH("includes/search.xhtml"),

        ALBUM_PREVIEW("includes/album.xhtml"),

        ALBUM_IMAGE_PREVIEW("/includes/image.xhtml"),

        SHELF_PREVIEW("/includes/shelf.xhtml"),

        ALL_SHELFS("/includes/userShelves.xhtml"),

        TAGS("includes/tag.xhtml"),

        ALL_ALBUMS("/includes/userAlbums.xhtml"),

        ALL_IMAGES("/includes/userImages.xhtml"),

        ALBUM_IMAGE_EDIT("/includes/imageEdit.xhtml"),

        ALBUM_EDIT("/includes/albumEdit.xhtml"),

        SHELF_EDIT("/includes/shelfEdit.xhtml"),

        SHELF_UNVISITED("/includes/shelfUnvisited.xhtml"),

        USER_SHARED_ALBUMS("/includes/userSharedAlbums.xhtml"),

        USER_SHARED_IMAGES("/includes/userSharedImages.xhtml"),

        ALBUM_UNVISITED("/includes/albumUnvisited.xhtml");

    ...

    }

This class specifies which file is included depending on some user action. The template to be loaded is identified according to some condition in the Controller (`Controllor.java`) class and is saved to the Model (`Model.java`). During `index.xhtml` page rendering the value is taken from the Model to define what should be rendered to the page.

### 3.1.2. Data Model

The data model of the application has the following structure:

Figure 3.3. Photo Album Data Model

- PrevChapter 2. Getting started
- Top of page
- Front page
- NextChapter 4. How it works