PacktLib: Apache OFBiz Development: The Beginner's Tutorial

Apache OFBiz Development


About the Authors

About the Reviewers


Getting Started with OFBiz

Getting the OFBiz Code

Downloading and Installing SVN

Installing the Java Development Kit (JDK)

Downloading OFBiz Ready to Launch

Setting Up an Eclipse Project

Using Derby—the OFBiz Stock Database

Running OFBiz

Switching Off OFBiz

Our First Tour of OFBiz


Working with OFBiz

Adding Our First Field

Resetting Our Play Area Quickly

The Structure of OFBiz in General

The Model-View-Controller Architectural Pattern


Screen Widgets

Equipping Our Webapp with a Screen Widget View Handler

Using the Screen Widget View Handler

Files and Locations

Creating Our First Screen Widget

The Anatomy of the


Nested Sections for Nested Conditions

Organizing a Large Screen into Smaller Screens

Screen Widget's Integration with FreeMarker

Cleaning Up in the "party" Component

Commenting Changes to the Core Code

Screen Widgets as Templates


Form Widgets

Files and Locations

Creating Our First Form Widget

Form Processing via Request Event

Java Events

Submitting and Processing Our First Form

The "list" Type Form Widget

The "multi" Type Form Widget

Alternative Targets in Two-Target Forms

Row-Level Actions


Other View Element Types in Screen Widgets

Menu Widgets


Bringing it All Together


The Controller

How OFBiz Hears Our Requests—The Control Servlet

Programming a Control Servlet


Entities, View Entities, and Extended Entities


View Entities

Extending Entities


Accessing the Entities and View Entities

Setting-Up Our Playground

GenericValue Objects

Creating a Database Record

Updating Database Records

Deleting Database Records

Retrieving Database Records

Using the Entity Engine Cache

Dynamic View Entities

Paginating Using the EntityListIterator

Functions and Dynamic View Entities


The Events

Java Events

Working with the Database


The Service Engine

Defining a Service

Creating the Java Code for the Service

Testing Our First Service

Service Parameters

The DispatchContext

Service Security and Access Control

Calling Services from Java Code

Implementing Interfaces

Synchronous and Asynchronous Services.

Using the Job Scheduler

Quickly Running a Service

Naming a Service and the Service Reference

Event Condition Actions (ECA)


Permissions and the Service Engine

Simple Permissions

Two-Part Permissions and Special "_ADMIN" Permissions

Role Checks

Combining Multiple Checks

Nested Checks

Complex Permissions



What is Minilang?

Defining a Simple Service

Simple Events

Validating and Converting Fields

Checking Security in Minilang

Invoking from Minilang

Minilang in Screen Widgets


Tying Up the Loose Ends

The OFBiz Look and Feel

Using FreeMarker

OFBiz Utilities

Outputting Different Formats


Tips and Techniques

Debugging Techniques

Debugging Java Code

Managing a Project Using Subversion

Apache HTTP Server and OFBiz using mod_proxy_ajp

Development Tips


Simple Method User's Guide

Simple Method User's Guide