One of the (main) goals of Apache Rave is to create an extendible platform. This document is to help Apache Rave users (developers) to customize Apache Rave based on needs.

To get you started we have created a Maven archetype that generates a Rave project. This project shows how to use a custom (Spring) component and to customize the look and feel. Extension developers will be able to use the POM file provide and add additional project dependencies.

Prerequisites

  • Java SE 6 or higher
  • Apache Maven 3+ (version 3.0.3 or later is required) Download and install

A Maven archetype will be available to generate a custom Rave project for the 0.19 release (January 2013) and future releases. You can also build this archetype from the latest (snapshot) code. To do this, check out Apache Rave from SVN and build with "mvn clean install".

Generate custom Rave project

In your console or terminal navigate to the folder where you store your projects. The archetype will create the folder of the project inside this folder. Then type:

mvn archetype:generate -DarchetypeGroupId=org.apache.rave -DarchetypeArtifactId=rave-custom-project-archetype

Maven will try to download the rave-custom-project-archetype. Then asks you to define the custom project's groupId, artifactId etc. The default values are:

groupId: org.example
artifactId: myraveproject
version: 1.01.00-SNAPSHOT
package: org.example
projectName: My Rave Project

Run the project

If you use the defaults, the project is called myraveproject and its portal module myraveproject-portal

cd myraveproject
mvn install

cd myraveproject-portal
mvn cargo:run

You can now navigate to the portal on http://localhost:8080

Custom project

The project will have the following structure:

Project structure

Customizations

  • User Service : implements Rave UserService interface as CustomUserService. To use CustomUserService for login a customUserService bean has been defined in the Application Security context provided in ./myraveportal-portal/src/main/webapp/WEB-INF/applicationContext-security.xml.

  • LDAP authentication has been removed from the project by excluding its dependencies in the pom.xml file and removing the LDAP configuration in ./myraveportal-portal/src/main/webapp/WEB-INF/applicationContext-security.xml.

  • Look and feel : This is to demonstrate that your own look and feel can be given to the portal by adding styles to ./myraveportal-portal/src/main/webapp/static/css/custom.css

  • There is also a separate module to override the OpenSocial provider (Apache Shindig), but it builds the same configuration as the standard release.

Best Practices

  • Add new javascript functions to new file or copy existing functions to new file and customize them and change imports based on your need. Reason is, changes/fixes in rave libraries should come to your project.
  • If you are are customizing css or adding new css methods add new files so that changes in default css files will come to your portal
  • Report any bug or issue to Apache Rave JIRA