Clone wiki

AspectFaces / 2.Installation

2. Installation

Aspect Faces uses Maven build mechanism and each our build is automatically published into CodingCrayons Maven repository. Both stables and snapshots. To see project condition feel free to check out our continuous integration server and for all published versions please checkout Maven repository.

Attach to project

For use of the framework in Maven based project, you have to specify Maven repository and dependency shown later. For non-maven projects, you have to download the release from our repository and attach it yourself.

Maven repository declaration

<repository>
    <id>codingcrayons-repository</id>
    <name>CodingCrayons Maven Repository</name>
    <url>http://maven.codingcrayons.com/content/groups/public/</url>
</repository>

Maven dependency for integration with JSF2

<dependency>
    <groupId>com.codingcrayons.aspectfaces</groupId>
    <artifactId>javaee-jsf2</artifactId>
    <version>${aspectfaces.version}</version>
    <type>pom</type>
</dependency>

If you are not comfortable with JavaServer Faces 2.1 or want to use it without them then you may attach only some subset of this meta-package, such as core and annotation-descriptors. The bad side this is unsupported on-demand compilation because by now we support it only for JSF 2.1.

Basic Configuration

Now you have attached Aspect Faces binaries to your project and you need to perform a basic setup. It consists of couple steps:

  1. Download our basic setup package for Maven-based project. It contains all necessary configuration. Merge this package with your Maven project directory
    • in /src/main/resources is located aspectfaces.properties with basic configuration of project structure
    • in /src/main/webapp/WEB-INF/ is file aspectfaces.taglib.xml containing JSF extension with new component handler
    • in /src/main/webapp/WEB-INF/ is file aspectfaces-config.xml containing list of AF profiles and used annotation descriptors
    • in /src/main/webapp/WEB-INF/ is directory af are defined widget profiles and templates. Feel free to inspect it and modify
  2. Update web.xml file. Insert following code snippets:

Aspect Faces Listener

<listener>
    <!-- Include Aspect Faces listener to perform proper framework initialization during application start -->
    <listener-class>com.codingcrayons.aspectfaces.plugins.j2ee.AspectFacesListener</listener-class>
</listener>

Use taglib with AF component

 <context-param>
    <!-- aspect faces components and namespaces have to be registered via taglib -->
    <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
    <param-value>/WEB-INF/aspectfaces.taglib.xml</param-value>
</context-param>

Do not forget to properly use project stage configuration

<context-param>
    <!-- in development mode is disabled cache, in production environment it is cached forever -->
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

Now you have properly defined Aspect Faces project and it is ready to use. Now please check your configuration, especially profiles and widget templates and customize them for your purposes including functionality and styling.

Updated