Book Image

Apache OfBiz Cookbook

Book Image

Apache OfBiz Cookbook

Overview of this book

Apache Open For Business (OFBiz) is an enterprise resource planning (ERP) system that provides a common data model and an extensive set of business processes. But without proper guidance on developing performance-critical applications, it is easy to make the wrong design and technology decisions. The power and promise of Apache OFBiz is comprehensively revealed in a collection of self-contained, quick, practical recipes in this Cookbook. This book covers a range of topics from initial system setup to web application and HTML page creation, Java development, and data maintenance tasks. Focusing on a series of the most commonly performed OFBiz tasks, it provides clear, cogent, and easy-to-follow instructions designed to make the most of your OFBiz experience. Let this book be your guide to enhancing your OFBiz productivity by saving you valuable time. Written specifically to give clear and straightforward answers to the most commonly asked OFBiz questions, this compendium of OFBiz recipes will show you everything you need to know to get things done in OFBiz. Whether you are new to OFBiz or an old pro, you are sure to find many useful hints and handy tips here. Topics range from getting started to configuration and system setup, security and database management through the final stages of developing and testing new OFBiz applications.
Table of Contents (15 chapters)
Apache OFBiz Cookbook
Credits
About the Author
About the Reviewers
Preface

Locating an OFBiz Application


An OFBiz "Application" is a set of directories and files that are located within a Component. Referred to as "webapps", an OFBiz Application may contain all the artifacts necessary to deliver a web browser-compliant UI. As a testament to its flexibility, an OFBiz instance and any OFBiz Component may include an unlimited number of webapps.

An OFBiz Application is defined by the presence of the webapp directory located just beneath a containing Component's top-level directory, and may include one or more of the following files and directories:

  • A single WEB-INF directory

  • Beneath the WEB-INF directory, find a web.xml deployment descriptor file

  • Also beneath the WEB-INF directory, a controller.xml controller servlet configuration file may be present

  • Many other resources may be present depending on the needs of the Application

Getting ready

To locate an Application, firstly the following should be taken care of:

  1. 1. Determine the name of the Application you are searching for.

  2. 2. Try to ascertain the Component in which this Application is located An OFBiz Component may have one or more OFBiz Applications within it.

How to do it...

To locate the Application, perform the following:

  1. 1. Navigate to the OFBiz install directory.

  2. 2. If you know the name of the Component in which this Application is located, navigate to that Component's top-level directory.

  3. 3. Open the ofbiz-component.xml file in the top-level Component directory. In this file, locate any XML elements starting with a webapp tag. There may be many of these declarations within a single ofbiz-component.xml file. Each declaration represents the configuration of a single OFBiz web Application. For example, the following is taken from the OFBiz e-commerce Component. Two OFBiz Applications, the"eccomerce" and the"ecomclone", are configured. The top-level directory location of each Component is given by the location attribute value for the webapp element:

    <webapp name="ecommerce"
    title="eCommerce"
    server="default-server"
    location="webapp/ecommerce"
    mount-point="/"
    app-bar-display="false"/>
    <webapp name="ecomclone"
    title="eCommerce Clone"
    server="default-server"
    location="webapp/ecomclone"
    mount-point="/ecomclone"
    app-bar-display="false"/>
    

How it works...

OFBiz Applications are configured for each Component using the ofbiz-component.xml file. If one or more webapp elements are present in an ofbiz-component.xml file, this is a trigger to OFBiz that there are Applications for this Component. OFBiz will attempt to load all Component applications in the order defined in the ofbiz-component.xml file at system startup.

There's more...

To mount an Application as the "root" Application, set the mount-point attribute value to"/" as shown earlier. This will change the default URL for this webapp from http://localhost:8080/name to http://localhost:8080/. Only one webapp may be set to the root mount-point per OFBiz instance.