Book Image

Apache OFBiz Development: The Beginner's Tutorial

By : Jonathon Wong, Rupert Howell
Book Image

Apache OFBiz Development: The Beginner's Tutorial

By: Jonathon Wong, Rupert Howell

Overview of this book

<p>Apache OFBiz (Open For Business) is versatile open-source enterprise automation software that powers many small and medium sized businesses around the world. It incorporates a number of mature applications such as ERP, e-Commerce, MRP and CRM.<br /><br />Built around an MVC framework with common logic, data model and process components, Ofbiz allows existing and bespoke applications to be added through a component-based architecture. Ofbiz includes a mature suite of enterprise applications that integrate and automate a company's many business needs.<br />&nbsp;<br />This easy-to-read book will quickly enable newcomers to get hands-on with OFBiz. It provides an overview of the main modules and employs illustrated examples that show readers how to build exemplary business applications rapidly. Covering the main aspects of the Model-View-Controller framework, the reader will gain a working knowledge of Widgets, Entities, and The Service Engine. The authors also describe how to tweak OFBiz, and offer valuable performance and development tips. By navigating through the flow of OFBiz and providing insight into the thousands of examples that already exist in the core code they have made this book a must-have for anyone looking to get started with OFBiz.</p>
Table of Contents (20 chapters)
Apache OFBiz Development
Credits
About the Authors
About the Reviewers
Preface
Simple Method User's Guide

Defining a Service


We first need to define a service. Our first service will be named learningFirstService.

In the folder ${component:learning}, create a new folder called servicedef. In that folder, create a new file called services.xml and enter into it this:

<?xml version="1.0" encoding="UTF-8" ?>
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "http://www.ofbiz.org/dtds/services.xsd">
<description>Learning Component Services</description>
<service name="learningFirstService" engine="java"
location="org.ofbiz.learning.learning.LearningServices" invoke="learningFirstService">
<description>Our First Service</description>
<attribute name="firstName" type="String" mode="IN" optional="true"/>
<attribute name="lastName" type="String" mode="IN" optional="true"/>
</service>
</services>

In the file ${component:learning}\ofbiz-component.xml, add after the last <entity-resource&gt...