Getting Started

with

Apache OFBiz™

In 5 Easy Steps

Ruth Hoffman Last Updated June 2010

Title: Getting Started with Apache OFBiz® In 5 Easy Steps Author: Ruth Hoffman ©2009-2010 Ruth Hoffman, All Rights Reserved

ISBN 978-0-9842907-2-7

About the Author: Ruth Hoffman has over 25 years of computer industry experience. She began her career designing and writing real-time command & control systems. From there, she moved into software engineering and technical marketing where she was responsible for operating systems, database and infrastructure product management, marketing and sales support. She has held roles in , training and software sales. Over the last several years, she has moved back to her roots designing and implementing complex enterprise software systems using state-of-the-art open source tech- nologies.

As an advocate of OFBiz, she has been using the OFBiz project software since early 2000 for a variety of successful enterprise projects including numerous e-commerce and ERP implementations. Her most recent project, myOFBiz.com, is an endeavor to use OFBiz exclusively to develop, market and distribute the highest quality learning resources for and about OFBiz. Please visit the website at: http://www.myofbiz.com

©2010 Ruth Hoffman, All Rights Reserved Page 2 Getting Started with Apache OFBiz® in 5 Easy Steps

Table of Contents

Introduction ...... 4 Purpose ...... 4 Who Should Read This?...... 4 Why Focus on OFBiz E-Commerce Features?...... 4 Why OFBiz?...... 5 OFBiz Makes Good Business Sense ...... 5 The OFBiz Framework Technical Advantage...... 5 Technical Framework “Freebies” ...... 5 OFBiz Out-Of-The-Box (OOTB) ...... 7 The 5 Steps to “Getting Started”...... 8 Step 1 Problem Definition...... 9 The “Getting Started” Problem Definition...... 9 Problem Definition – Business Goals...... 9 Problem Definition – Technical Goals...... 9 Problem Definition – “Getting Started” Goals...... 9 Step 2 Perform Gap Analysis ...... 11 Step 3 Site Prep and Download ...... 13 Step 4 Prototype “Getting Started” Goals ...... 14 Prototyping Part I...... 14 First, Evaluate The Download ...... 14 Prototyping Part II ...... 15 Evaluate Each Goal/Requirement From Step 1...... 16 Goal 1: Store Branding...... 16 Goal 2: Adding New Products to OOTB Store...... 17 Goal 3: New Products & Shopping Cart Test...... 19 Goal 4: New Products & Order Creation ...... 20 Goal 5: Order Branding...... 21 Goal 6: Password Protected User Accounts...... 22 Goal 7: Support for Offline Payment Methods...... 23 Goal 8: Digital Products & Product Shipping ...... 25 Goal 9: Store Promotions ...... 26 Goal 10: Store Promotions w/Coupon ...... 27 Step 5 Review Results...... 29 The “Getting Started” Results...... 29 Beyond Getting Started ...... 30

©2010 Ruth Hoffman, All Rights Reserved Page 3 Getting Started with Apache OFBiz® in 5 Easy Steps

Introduction

You've heard great things about Apache Open for Business™ (OFBiz™). Maybe you've even visited the new official OFBiz home at the Apache Foundation http://ofbiz.apache.org. Perhaps you have stumbled upon one or more OFBiz success stories.1 Now you want to try it out and see for yourself what all the excitement is about.

Purpose

Here is a roadmap to get you up and running with OFBiz quickly and with a minimum of frustration. Originally authored as a companion to the “Getting Started w/Apache OFBiz™ In 5 Easy Steps” presenta- tion delivered at the 2009 ApacheCon conference, this document takes an end-user look at a few quick things you can do to “kick the OFBiz e-commerce tires”. Step-by-step instructions walk you through tasks that, in less than an hour, will have you up and running with your very own e-commerce website store powered by OFBiz.

Who Should Read This?

Intended as a quick start guide, anyone interested in learning more about the OFBiz software suite's e- commerce features will find this read useful. It quickly cuts to the chase and shows the reader how to get started evaluating OFBiz tools specific to supporting e-commerce. The reader is not expected to have any special knowledge of: programming languages, software design techniques or database administrative tasks.

Why Focus on OFBiz E-Commerce Features?

While OFBiz is a fully functional ERP2 software package, complete with a flexible, open, easy to customize framework, this document focuses on Out-Of-The-Box (OOTB) e-commerce capabilities. This direction was chosen for two reasons. First, “E-Commerce” is an accepted part of the business lexicon. That is, everyone understands e-commerce and that gives us common ground from which to present OFBiz features, functions and benefits.

Second, the OFBiz download is packaged with a substantive e-commerce demonstration, making it easy to present examples and showcase e-commerce features and functions. This e-commerce demonstration is seamlessly integrated with other OFBiz applications such as accounting, inventory/asset management, manufacturing and content management.

Now that you know what this whitepaper is, let's review what it is not:

 This whitepaper is not an OFBiz development guide.  This whitepaper is not an OFBiz guide to moving into production.  This whitepaper is not an OFBiz administration and operations manual.

1 http://docs.ofbiz.org/display/OFBIZ/Apache+OFBiz+User+Stories 2 Enterprise resource planning (ERP) is the set of software applications providing complete business automation solutions using a single enterprise database.

©2010 Ruth Hoffman, All Rights Reserved Page 4 Getting Started with Apache OFBiz® in 5 Easy Steps

Why OFBiz?

If you already know why OFBiz should be your ERP and/or e-commerce solution, then skip to the section titled “The 5 Steps to Getting Started”. Otherwise, read on and learn more about the OFBiz advantage.

OFBiz Makes Good Business Sense

If the fact that OFBiz is distributed under the Apache 2.0 license, free to download and use as you see fit, isn't enough to make you jump for joy, consider these compelling reasons to try OFBiz:

Fully Integrated Enterprise Resource Planning Software Suite. From the shop floor to the sales floor, products, orders, customers, and your business is completely and seamlessly connected. Save yourself years of head- ache and heartache. No need to develop another web service or initiate a costly application integration project. See for yourself the productivity gains associated with an all-in-one ERP solution.

Reliable, secure and proven framework means no more reinventing the wheel. The OFBiz framework (See Figure 1.0) is built from best-of-breed technology. Everything from the Secure Sockets Layer (SSL) support to the database connection tools are industry best-of-breed. These are the same infrastructure pieces that are found in many of the most popular commercial software offerings3 costing tens of thousands of dollars. Best of all, you don't need to put the framework together: simply download, customized and go!

Flexible J2EE based framework makes adding new components a snap. No need to rebuild the framework stack or the database interfaces. This will save you time and money should you find a business requirement not matched by OFBiz OOTB.

Backed by a vibrant community of developers. The OFBiz community is not sitting still. Look for continual en- hancements to the base product as well as commercial add-ons.

The OFBiz Framework Technical Advantage

The OFBiz framework does all the heavy lifting. No matter what your business requirements demand, you can quickly prototype ideas because, OOTB OFBiz has all the tools, utilities and the core functionality required by most enterprise applications. With core features already in place, you can quickly get down to the business of building your unique application. This saves time, money and lifecycle maintenance is simplified.

Technical Framework “Freebies”

Integrated Secure Sockets Layer (SSL) support. If your application requires secure user login (and what multi-user enterprise application doesn't?) then OFBiz has all the pieces necessary to support password protected access to all business and framework functions. Role based access predicated on security groupings is supported OOTB. Numerous services exist to allow a developer to extend security controls to new applications or customize levels of access on existing applications.

If your application requires secure web pages (SSL), there is no need to build URL translation between secure and non-secure web pages into your application. Using the framework, transition between secure and non-secured URLs is as simple as editing an XML file.

3 See the OFBiz Wiki for more information on framework components: http://http://docs.ofbiz.org/display/OFBIZ/Open+Source+Projects+and+Standards

©2010 Ruth Hoffman, All Rights Reserved Page 5

Simplified data modeling and database administration. You won't need a database expert (Database Administrator or DBA) to build or manage your database. You won't need to write embedded SQL or manage database transactions or connection pooling. Best of all, no Enterprise Beans (EJBs). The OFBiz Entity Engine makes persisting Enterprise data and managing databases a snap. Once you understand the OFBiz EE you will never go back to writing embedded SQL. Of course, if you are a masochist, you can still write your own embedded SQL, but you don’t have to.

The database schema is included as an integral part of the project distribution. No need to write or maintain database schemas. A complete ERP schema based on industry best practices as documented in Len Silver- ston’s “The Resource Book, Revised Edition, Volumes 1 & 2” comes with the distribution. No integration required. Of course, using XML, you may easily add your own database tables and relationship definitions but there is rarely a need to. Best of all, OFBiz and the ERP schema work on just about any database imaginable.

Easy access to system and application configuration. All configuration not handled by framework HTML form based tools and persisted with a database, is done through XML and plain text Java properties files. Anyone with knowledge of a text editor may configure an OFBiz instance. [Here's a little known fact: OFBiz implemented “Inversion of Control and Dependency Injection” long before Spring4.]

Service oriented, event driven framework. A service oriented framework that lets you write code once and reuse it as many times as you want. OFBiz was designed from the ground up to be service oriented. OFBiz was there from the beginning with a true service and event driven framework. Applications you write can avail themselves of any or all of the many hundreds of services available OOTB. You can even write your own services.

No Java Server Pages (JSP), unless of course, you want to write JSP. You gotta love it that you don’t have to maintain JSP code. Instead, OFBiz has integrated the Freemarker5 templating engine, complete with custom macros, making the job of writing and maintaining HTML much easier. With OFBiz, HTML, CSS and Javascript experts work on the customer facing web pages without having to wade through JSP code.

4 Spring J2EE Enterprise Software Development: http://www.springsource.org 5 http://freemarker.sourceforge.net

©2009 Ruth Hoffman, All Rights Reserved Page 6 Getting Started with Apache OFBiz® in 5 Easy Steps

OFBiz Out-Of-The-Box (OOTB)

Before getting started with e-commerce, a quick overview of OFBiz Out-Of-The-Box (OOTB) is in order. OFBiz is much more than an e-commerce store on steroids. The download package comes chock-full of ready to use enterprise automation applications all seamlessly connected and interacting through a robust, secure, service oriented framework. Figure 1.0 depicts many of the OOTB applications.

Custom applications may be easily added to extend the framework meeting even the most demanding enterprise automation needs.

Figure 1.0 The OFBiz Enterprise, OOTB

The OFBiz Enterprise is a collection of seamlessly integrated enterprise automation applications built atop a reliable, maintainable and secure state-of-the-art J2EE framework. OOTB, you get everything necessary to automate even the most sophisticated enterprise environments.

©2010 Ruth Hoffman, All Rights Reserved Page 7 Getting Started with Apache OFBiz® in 5 Easy Steps

The 5 Steps to “Getting Started”

Getting started with OFBiz has never been easier. Follow these five steps and have an OFBiz e-commerce store up and running in no time:

Step 1 Problem definition. Problem definition involves articulating goals and specifying requirements. Goals may be detailed documents or simple statements of required functionality. Consider using the “Holistic Enterprise Mechanism Process” (HEMP) developed by David E. Jones6 specifically for use with enterprise software frameworks such as OFBiz. Using HEMP gives you the added advantage of synergy with many existing HEMP stories used to document OFBiz business rules.

Step 2 Perform gap analysis. Document the differences between what OFBiz OOTB has to offer and the goals/requirements identified in Step 1. The identification and recording of “gaps” help set expectations and allow for a baseline from which to measure success. Use this step to add to your knowledge of OFBiz. Browse the existing OFBiz literature including the Wiki. Join the OFBiz user and dev mailing list.

Step 3 Site preparation and download. Prepare your workstation or laptop to download OFBiz. Get the correct version of Java. After verifying your Java installation, connect to the internet and download a version of OFBiz.

Step 4 Prototype goals from Step 1. The prototype step involves three sub-tasks: First, always test your download and determine a baseline. Next, take each goal from Step 1 and implement a prototype. Finally, test the prototype comparing observed results to expectations based on the gap analysis prepared in Step 2.

Step 5 Evaluate Results. After prototyping, take a step back to review results.

In the following sections, we look at each step in more detail.

6 http://www.dejc.com/home/HEMP.html

©2010 Ruth Hoffman, All Rights Reserved Page 8 Getting Started with Apache OFBiz® in 5 Easy Steps

Step 1 Problem Definition

Treat the “Getting Started” endeavor like a project. Start the project by writing down what you expect to accomplish. This step may include written goals and/or requirements. Problem definitions may be simple verb phrases such as “download code” or formal requirements. You may even want to investigate David Jones' Universal Business Process Library (UBPL) tools documented in:

http://www.dejc.com/home/HEMP.html

Whatever method suites your style, it is important to define and document the problem. Without a clear understanding of the problem, it is not possible to develop a rational solution and hence, there will be no way to measure successful outcomes regardless of the diligence paid to the other steps in this process.

The “Getting Started” Problem Definition

For the “Getting Started” project, we shall use the real life example of the myOFBiz.com (http://www.myofbiz.com) business venture. Naturally, we can't document all the goals and requirements necessary to bring myOFBiz.com to fruition. Rather we shall settle for a few basic goals in each of the following three areas: business, technical and “Getting Started” specific challenges.

Problem Definition – Business Goals

Goal #1 – The primary myOFBiz.com business goal is to be a complete web based, self-sustainable business. Our goal and requirement is to: “eat our own dog food”, using OFBiz exclusively to run the business.

Goal #2 – Whatever automation solution is selected, it must be able to grow as the business grows. No reinventing the wheel.

Goal #3 – Devote our financial resources to developing and delivering the highest quality OFBiz learning materials possible and not to writing software or maintaining costly hardware and/or software applications.

Problem Definition – Technical Goals

Goal #1 – One system and one database. We can't afford to support more than one deployment system or more than a single database. Our limited resources will be focused exclusively on our business goals and not on maintaining a large staff of programmers, database administrators or operations personnel.

Goal #2 – A secure, robust, proven platform that supports basic e-commerce from the get–go. E-commerce features must include: store based shopping cart, the ability to sell myOFBiz.com products including digital downloads and physical (shippable) items; checkout with customizable shipping and payment features; automatic order creation; password protected user accounts with order history.

Goal #3 – The framework must be easily extended so that custom applications may be added as needed without disrupting existing service delivery.

Problem Definition – “Getting Started” Goals

The following table lists our 10 “Getting Started” goals. These goals/requirements shall form the basis of our prototypes and the remainder of this document.

©2010 Ruth Hoffman, All Rights Reserved Page 9

Table 1.0 10 “Getting Started” Requirements/Goals Goal Description 1 Using tools provided with the distribution, how hard or easy is it to brand the demonstra- tion website store with the myOFBiz.com brand? Does this prototype goal require special technical skills? 2 Using tools provided, can we add myOFBiz.com products to the store? Digital products and products that require shipping must both be considered. 3 Does the shopping cart still work with myOFBiz.com products? 4 Does the checkout logic still work with the additional myOFBiz.com products? Is an order created? 5 Is the order branded correctly? 6 Are the user's account and order management web page(s) password protected? 7 Does the store support offline payment processing OOTB? Can we post payment for an offline order? Do we need any special skills (such as Java development to build interfaces) to post a payment? 8 Once the order is paid for, will the user have access to digital products and/or will myOFBiz.com as the store owner be notified to ship physical products? 9 Is the user notified at various stages of order lifecycle? 10 If promotions [such as “buy one, get one free”] are added to the prototype store, is there a requirement to rebuild products, catalogs or the store?

©2009 Ruth Hoffman, All Rights Reserved Page 10 Getting Started with Apache OFBiz® in 5 Easy Steps

Step 2 Perform Gap Analysis

Any project with a hope of succeeding should include a gap analysis. Without the gap analysis, there is no way to measure success. Since our “Getting Started” project is simple and has only some very basic goals, our gap analysis will be minimal.

Table 2.0 Simple Gap Analysis for “Getting Started” Requirement OFBiz Feature GAP Notes Yes/No General Business/Technical Goals Totally Web All apps are browser enabled. No No The primary OFBiz user Based Business special User Interface (UIs) need interface tool is a web be developed or supported. browser. With the possible exception of the point-of- sale feature, the entire OFBiz Enterprise is interfaced using web browser enabled tools. Flexible Frame- Open APIs, XML based screen No work and form widgets, service oriented architecture for reusable code. Royalty Free Apache 2.0 License. No Open Source One database Complete ERP database schema No many uses. No integrated with distribution. need for a DBA to get started. “Getting Started Goals” Initial download Does the website store provided No Run through the distribu- testing with the download work? Can tion demonstration store. products be added and removed from the shopping cart? Does the checkout process complete successfully and conclude by creating an order?

©2009 Ruth Hoffman, All Rights Reserved Page 11 Getting Started with Apache OFBiz® in 5 Easy Steps

Table 2.1 Simple Gap Analysis for 10 “Getting Started” Goals Prototype Task Description Notes/Questions Goals Using tools provided, can we brand the Use the Catalog Manager application 1 demonstration website store? to brand the website store and the Party Manager application to change default company name and other contact info. 2 Using tools provided, can we add our Use the Catalog Manager application products to the store? Digital products to define products, add products to a and products that require shipping. catalog and create a new catalog. 3 Does the shopping cart still work with Can we still add, remove and our products? recalculate the cart totals with the new products? 4 Can we checkout with the products and create an order? 5 Is the order branded correctly? Is the myOFBiz.xom company name prominently displayed on the order and various other documents? 6 Are the User's account and order management web page(s) password protected? 7 Can we post payment for an offline How integrated is the e-commerce order? store with other ERP functions such as accounting? 8 Once the order is paid for, can we access How integrated is the e-commerce digital products and/or ship physical store with other ERP functions such products? as order management? 9 Shopping cart price adjustments. How difficult is it to add automatic If we add promotions to our store, do we price adjustments to the shopping need to rebuild products, catalogs or the cart based on the items the User has store? in the cart at checkout. 10 Adding coupons or promotional codes to How flexible is the pricing and existing promotions. promotion framework? Is it neces- sary to write Java programs or modify existing code to add promo- tional adjustments to the shopping cart and order?

©2009 Ruth Hoffman, All Rights Reserved Page 12 Getting Started with Apache OFBiz® in 5 Easy Steps

Step 3 Site Prep and Download

Now we are ready to start some real work. Site preparation simply means getting your chosen desktop or laptop host system ready to download a version of OFBiz software.

“Getting Started” Prerequisites7:

. Any desktop or laptop system that is capable of running Java 1.5.

. The Java 1.5 SDK (The Sun Distribution is the reference version of Java used to build and package OFBiz for download).

. 500-700MB of free disk space.

. 500MB minimum memory.

“Getting Started Download” To follow along and get your own copy of OFBiz, please visit the official Apache OFBiz website download page: http://ofbiz.apache.org/download.html

Look for the latest stable release. At this writing, OFBiz Release 09.04 is recommended.

Author’s Note: Even after much to-do about a recent website makeover intended to make the Apache OFBiz download site easier for new users to navigate, the site may still be confusing to the uninitiated. Don’t fret, you are not alone. This site was built and is maintained by Java developers. You will not find many end-user friendly frills here. The author suggests: Just look for the section on the site labeled “09.04 Stable Release” and click on the file named: apache-ofbiz-09.04.zip

Everything you need to run OFBiz is in the packaged zip file. Simply unzip it using your operating system tool of choice and let the fun begin!

7 Note: These are recommendations for a “Getting Started” environment, not for development or production ready hosts.

©2009 Ruth Hoffman, All Rights Reserved Page 13 Getting Started with Apache OFBiz® in 5 Easy Steps

Step 4 Prototype “Getting Started” Goals

We have downloaded OFBiz, what next? Before moving on to the core getting started step in which we test OFBiz against our requirements and goals developed in Step 1, it is really important to set a baseline.

Prototyping Part I The prototyping activity has intentionally been divided into two parts. Part I involves verifying that the download software works as expected. Because OFBiz is a community based project, there is always the chance that the download has not been as thoroughly tested as one would like. Therefore, before we begin introducing new variables into the test environment, it is best to make sure we have a good working copy of the software.

First, Evaluate The Download

Evaluate the download to ensure a clean, working baseline. OFBiz comes with a fully functional demonstra- tion e-commerce store. Observe and test the download software with special attention to the web store. Only after testing the download, should any prototyping efforts commence.

When you enter in the URL for the OOTB website store do you see the proper default landing page as shown in Figure 2.0? If not, then you may have a bad download. In that case, download the software again.

©2009 Ruth Hoffman, All Rights Reserved Page 14

Figure 2.0 The OFBiz E-Commerce Landing Page (Release 09.04) OOTB

After confirming a successful download, other website store testing to perform may include:

√ Changing catalogs and categories √ Adding and removing products to/from the shopping cart √ Searching for products √ Checkout out and create an order √ View user account information on the “Order History” web page

In addition to store testing, it is suggested that you login as the administrative user to the “WebTools” (http://localhost:8080/webtools) and Catalog Manager (http://localhost:8080/catalog) applications to ensure they are working properly and to get a feel for these useful OFBiz tools.

Prototyping Part II

Next, with a known, valid baseline, begin the process of prototyping the “Getting Started” goals/requirements. In the following sections we shall take each requirement from Step 1 and propose a prototyping solution followed by suggestions on how to test the prototype.

©2009 Ruth Hoffman, All Rights Reserved Page 15

Evaluate Each Goal/Requirement From Step 1

Goal 1: Store Branding

Using tools provided, can we brand the demonstration website store. How hard is it to change basic website HTML header items such as the store name and other unique identification?

Prototype Solution

Using the OFBiz Catalog Manager application we can easily change the OOTB website store web page view to have a, unique store name and title prominently displayed in the header, as shown in Figure 3.0. We have also taken the liberty of using the Catalog Manager to change the default web store theme. Themes are an exciting new feature available in release 09.04.

√ Use the OFBiz Party Manager application to change the default store company name and contact address for identifying our prototype project store. [Note: not show here.] √ Use the OFBiz Catalog Manager application to change the store web theme, title and subtitle.

Total time required: 10 minute

Figure 3.0. OFBiz web store after theme change and store name change.

©2009 Ruth Hoffman, All Rights Reserved Page 16 Getting Started with Apache OFBiz® in 5 Easy Steps

Goal 2: Adding New Products to OOTB Store

Using the tools provided, can we add our products to the store? The “Getting Started” product set includes three items for sale consistent with our e-tailing business model: two digital eBooks and a physical object, a dog food bowl with the myOFBiz.xom logo. The digital books are created offline and moved to a location within the OFBiz instance as PDF files. After the store receives payment for digital items, they become available for download. As there is no physical inventory associated with eBooks, there is no need for the OFBiz ERP software to track product availability or shipping status.

The logo'd dog food bowl is a physical item kept in inventory and shipped after payment is received. The myOFBiz store must keep track of payment receipts and allow for inventory reductions when payment is received for this item.

How difficult is it to get our three products to show up on the website store?

Prototype Solution:

Using the OFBiz Catalog Manager:

√ To demonstrate additional branding capabilities, change the “Order Prefix Number” to something unique for the new store. √ Create three new products: two digital downloads and one physical product according to the follow- ing product characteristics:

Product ID Default Short Description Shipping weight/size Price P001 39.95 Getting Started w/The Apache OFBiz N/A Catalog Manager P002 29.95 Getting Started with Apache OFBiz E- N/A Commerce. This book reveals all. P003 14.50 Eat your own dog food with this logo’d 16 oz MYOFBiz.com dog food bowl. 6 inches X 6 inches X 4 inches

√ For the digital downloads, use the OFBiz Content Manager to assign each file a Data Resource Identifier and a Content Identifier record. √ Add the Data Resource Identifier and Content Identifier to the product definition. √ Add default pricing to the new products. √ Create a new catalog called “Ruths Products”. √ Create the “Browse Root” and “Promotions” categories for the new catalog. Change the title of the “Promotions” category from “Featured Products” to “Select From Our Most Recent Additions”. √ Add the three new products to the new “Promotions” category. √ Add the new Catalog to the “OFBiz E-Commerce Store”.

Total time required: 30 minutes [Note: for more information on how to use the Catalog Manager to configure one or more OFBiz web stores, please see the OFBiz Wiki or “Getting Started w/Apache OFBiz, The Catalog Manager” (http://www.myofbiz.com).

©2009 Ruth Hoffman, All Rights Reserved Page 17

Figure 4.0 OFBiz Website Store w/New Catalog and Products. The new catalog (Ruths Products) with new “Featured Products” category now called “Select From Our Most Recent Additions” shows all three new products.

©2009 Ruth Hoffman, All Rights Reserved Page 18 Getting Started with Apache OFBiz® in 5 Easy Steps

Goal 3: New Products & Shopping Cart Test

Does the shopping cart still work with our new products?

Prototype Solution:

Add, remove and change quantities for all three products. Observe that the shopping cart shows correct product information under each circumstance.

Figure 5.0 Shopping Cart View w/New Products. Add and remove products from the cart. Observe results.

©2009 Ruth Hoffman, All Rights Reserved Page 19 Getting Started with Apache OFBiz® in 5 Easy Steps

Goal 4: New Products & Order Creation

Can we checkout with the new products and create an order?

Prototype Solution:

Select the “Quick Checkout” link from any available location. Observe the single form checkout as shown in Figure 6.0 below (Please note, in an effort to present the most legible screen shots, we have reverted back to the default eCommerce application website theme using the Catalog Manager and without restarted OFBiz):

 

Figure 6.0 Single Page Checkout Form

Review the single form checkout page to verify:  Contact information is still correct.  Shipping estimates are in line with purchased product configuration(s). Note, selection of UPS Air for later order validation.  “Special Instructions” shows up on both the order and on the Order Manager shipping views.  “Gift Message” shows up on both the order and the Order Manager shipping views.  Note: Payment type of “Mail Check/Money Order” selected. User agrees to pay by sending a check or money order to the store contact.

©2009 Ruth Hoffman, All Rights Reserved Page 20 Getting Started with Apache OFBiz® in 5 Easy Steps

Goal 5: Order Branding

Is the order branded correctly? Does our store name and address display correctly on the order?

Prototype Solution:

From the “Quick Checkout” form select “Submit Order” [Note: Final order review and the “Submit Order” button are not shown here.]. Did the e-commerce application successfully create an order? If so, your screen will look similar to the “Order Confirmation” screen displayed in Figure 7.0 below.

  

Figure 7.0 Order Confirmation Screen Returned By OFBiz and As Seen By User

Verify the following:  The order number is consistent with our store settings and new order number scheme.  The payment method information is consistent with “Mail Check/Money Order” as selected above.  The shipping costs for the product P003 is automatically added to order.  The shipping destination and carrier is correct.  The special gift and gift handling messages appear on the order as entered on the checkout screen.

©2009 Ruth Hoffman, All Rights Reserved Page 21 Getting Started with Apache OFBiz® in 5 Easy Steps

Goal 6: Password Protected User Accounts

Are the User's account and order management pages password protected? Does the User see the new order created in their online account?

Prototype Solution:

Select the “Order History” link from the website store's top navigation tabs. You will be prompted to enter a User name and password. Successful login will provide access to the User's order history web page as shown in Figure 8.0 below.

Note, to simplify this discussion, the default administrative user (“admin”) was used to create this order. In Figure 8.0 the admin user has logged in and accessed the admin User’s Order History web page. It is left as an exercise to the reader to create a new user and run through the checkout process with the newly created User. OFBiz also supports anonymous checkout. In cases where the User has checked out anonymously, the user will need to create an account in order to access Order History.   

 

Figure 8.0 User's “Order History” web page shows all orders including current status. This web page also contains any links for digital downloads purchased and paid for by this User.

Verify the following:  Logout link consistent with a logged in User.  Order #, amount and status consistent with the Order Manager screen shot.  Shopping cart is automatically emptied after an order has successfully been created.  Link to see order details.  No download files in the “Download Files Available” because this order still has not been paid for. Consistent with the selection of an offline payment method.

©2009 Ruth Hoffman, All Rights Reserved Page 22 Getting Started with Apache OFBiz® in 5 Easy Steps

Goal 7: Support for Offline Payment Methods

Is it possible to post payment for an offline order and have that payment be reflected in the User's account history?

Prototype Solution:

Login into the OFBiz Order Manager application and find order #MY_CP10001. Click on the “Receive Payment” button to bring up the OFBiz Accounting Manager application. Enter in a payment value of $81.66 USD for this order. [Note: the Accounting Manager receive payments screen is not shown here.] 

 

Figure 9.1 Order Manager Application Before Payment Posted

[Note: Because it makes the most legible screen shots, we use the “Flat Grey” theme for many of the graphics in this document. This is not the default theme that comes with the download. For more information on OFBiz themes, please see the OFBiz Wiki.

©2009 Ruth Hoffman, All Rights Reserved Page 23 Getting Started with Apache OFBiz® in 5 Easy Steps

 Login to the Order Manager screen and view order #MY_CO10001. Current status set to “Cre- ated”. Consistent with web store checkout and order creation process.  Contact information as it appears in this User's account profile.  Link to OFBiz Account Manager application to receive an offline payment. Use this link to post payment for this order.  Product shipping information including special instructions and gift message.  Order Manager application screen for order #MY_CO10001 after payment has been received and posted.  Payment method was cash and $81.66 was paid. Immediately after payment is typed in the Account- ing Manager payment screen, this order's status changes to “Approved”. After items are shipped, the order's status is set to “Complete”.  Shipment packing information appears after order has been paid.

 

 

Figure 9.2 Order Manager Application After Payment Posted Using Accounting Manager

©2009 Ruth Hoffman, All Rights Reserved Page 24 Getting Started with Apache OFBiz® in 5 Easy Steps

Goal 8: Digital Products & Product Shipping

Once the order is paid for, can the user access purchase? Will OFBiz keep the buyer from downloading product until payment is received?

Prototype Solution Return to the User's “Order History” page (or refresh this page after payment has been received.) Observe that each product now has a download link associated with it.

Figure 10 User's Order History screen now shows the order has been “Approved” and download links for digital products are made available.

 Order now is “Approved”.  Links to download each product are provided.

©2009 Ruth Hoffman, All Rights Reserved Page 25 Getting Started with Apache OFBiz® in 5 Easy Steps

Goal 9: Store Promotions OFBiz supports some very handy tools to automatically add or remove store based promotions. Where a promotion is a shopping cart pricing adjustment, or, in some cases the addition of products at no charge to an order, OFBiz allows any number of promotions per store. In this goal, we look at how difficult is it to add a store based promotion.

Prototype Solution Using the Catalog Manager:

√ Enter in a new “Promo”. This promotion will automatically take $10 off the shopping cart total only if the User purchases $50 or more of product and they are able to enter in the promotional code. √ Apply the new “Promo” to the “OFBiz E-Commerce Store”. Be sure to insert an effective date of on or before the current date. √ Nothing more is needed to make this effective. (You do not need to restart OFBiz.)

Total time required: 10 minutes.

Figure 11 Shopping Cart Promotion

©2009 Ruth Hoffman, All Rights Reserved Page 26 Getting Started with Apache OFBiz® in 5 Easy Steps

Goal 10: Store Promotions w/Coupon

Add a coupon/code to an existing promotion to test the flexibility of the OFBiz promotional framework.

Prototype Solution Using the Catalog Manager: √ Select the “Promo” created in Goal 9 above. √ Update it by changing the “Req. Code” field to “Y” √ Create the new promotion code of: “myofbiz” √ Apply the new promotion code to this promotion √ No further actions are required to make this effective. (You do not need to restart OFBiz.)

Total time required: 10 minutes.

Figure 12.1 The shopping cart and promotional details inset shows the requirement for a usage code.

©2009 Ruth Hoffman, All Rights Reserved Page 27

Figure 12.2 The shopping cart after promotional code has been applied. The automatic promotional adjustment is now shown.

©2009 Ruth Hoffman, All Rights Reserved Page 28 Getting Started with Apache OFBiz® in 5 Easy Steps

Step 5 Review Results

In Step 5 we ask ourselves if we've been successful in demonstrating that OFBiz has met or exceeded our original goals and requirements. Was our prototyping sufficient to test our original requirements? If so, how well did we do?

The “Getting Started” Results

In summary, we have demonstrated a number of “Getting Started” prototypes. These prototypes tested and successfully demonstrated OFBiz features required to meet our “Getting Started” goals. In a short amount of time and using only the OFBiz tools available with the download, we :

Established a working website store complete with our unique products(digital products and physi- cal inventoried items), shopping cart, integrated checkout and order creation.

Successfully brand the OFBiz website store and created our own product catalog complete with our own products.

Added store based promotions and observed that the OOTB shopping cart operates consistently regardless of the product set and applicable promotions.

Observed that customer checkout and order creation requires no additional customization and works seamlessly with our new products.

Did we succeed in “Getting Started” with OFBiz? You be the judge.

©2009 Ruth Hoffman, All Rights Reserved Page 29 Getting Started with Apache OFBiz® in 5 Easy Steps

Beyond Getting Started

A successful “Getting Started” experience should leave you asking for more. What are the next steps? That depends on your objectives. Refer back to “Getting Started” Step 1 and write down your goals. From there, do the gap analysis and decide if OFBiz has the applications, tools and/or infrastructure services in place to easily meet your objectives. If so, then begin the prototype process. If your next step goals include any of the following objectives, then here are some suggestions for moving forward:

To more fully understand product and store management, study the OFBiz Catalog Manager.

Create a variety of product types and add them to catalogs and catalog categories. Checkout the catalog building tools and see how to create multiple hierarchies of products that may be easily selected for viewing on the website store.

Using the Catalog Manager experiment with product pricing and store promotions.

If you are ready to move beyond the capabilities of the Catalog Manager and wish to change the “look & feel” of an OFBiz store, you will need to be somewhat versed in: text editing on your development system of choice (any system that supports the Java 1.5 SDK will work), XML, HTML, CSS and perhaps Javascript. Because most of the “look & feel” is handled directly through text file manipulation, you will also need to understand the OFBiz software directory and file layout scheme.

The best way to get started with these objectives in mind is to download the software, and use an Integrated Development Environment (IDE) such as Eclipse, Netbeans, or IntelliJ to help navigate the many files and directories that make up the project. For more information on OFBiz and Eclipse integration see: http://docs.ofbiz.org/display/OFBIZ/Eclipse+Tips

We leave you with one final hint for next steps: Whatever your OFBiz objectives, it has probably been considered before, so check out the OFBiz Wiki: http://docs.ofbiz.org/pages/listpages-alphaview.action?key=OFBIZ

And, of course, we’d love to see you purchase our books. Please visit our website at: http://www.myofbiz.com for the latest selections.

©2009 Ruth Hoffman, All Rights Reserved Page 30