About jReCo

jReCo controls the rendering state of JSF components. By defining rules the developer may control rendering state of application components externally without the need to touch JSF or Java code. |diagram|



The usage scenarios include:

  1. User authorization (building UIs based on user privileges)
  2. Building UIs depending on application properties’ state
  3. Dynamic rule systems / right assignments

jReCo stands for JSF Rendering Controller. The framework makes development of rule based application UI rendering a breeze. It removes the complicated and often hard to follow component rendering logic into a separate definition file. The application architecture becomes better structured and more readable.

Features

Component rendering state modification - jReCo lives in context of the JSF web application. It modifies the rendering state of UI components by the result of defined rules. Besides UI components jReCo supports value modification of Boolean attributes.

User authorization – displaying parts of the application to which the signed in user owns the privileges.

Simplicity - jReCo uses its own language that is similar to Java. The application’s rendering rules are specified in files with *.jreco extension.

Efficiency - The architecture of jReCo allows for high performance rule execution. The conditions are analyzed and loaded into the memory at startup.

Extendibility - Developers can create their own application specific java methods and register them within jReCo’s registered methods. These methods can be referenced from rule definitions.

Simple example

Note: This might be some existing code in your application.

Jsp code snippet that creates "Project" drop down menu:

<rich:dropDownMenu value="Project" binding="#{menu.projectMenu}" id="menuProject">

Backing bean (menu) Java code for jsf binding purposes:

.
.
  private HtmlDropDownMenu projectMenu = new HtmlDropDownMenu();


  public HtmlDropDownMenu getProjectMenu() {
	return projectMenu;
  }


  public void setProjectMenu(HtmlDropDownMenu projectMenu) {
	this.projectMenu = projectMenu;
  }
.
.

Lets use jReCo rule to say that "Project" menu item will be dispayed only when the logged in user is a Project manager.

jReCo rule definition:

projectManagerMenu(menu.projectMenu){

  isUserInRole[project_manager]

}
  1. We optionally named our rule "projectManagerMenu".
  2. Putting "menu.projectMenu" in brackets right after the rule name we said that the rule applies to "menu.projectMenu" component.
  3. The rule itself is defined inside curly braces block. We passed name of user role to "isUserInRole" jReCo registered method.

For complete info on writing jReCo rendering rules read the tutorial.

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
png
jrc.png 49.1 kB 1 18-Jul-2008 09:21 Robert
« This page (revision-) was last changed on 28-VII-2008 22:08 by Robert [RSS]