BLOG

NEXT STEPS

Posts Tagged ‘OFBiz Components’

Enterprise E-Commerce and ERP: Common Questions Series Part 1

Thursday, February 18th, 2010

hotwax-media-ofbiz-expert

2010 is off to a great start at HotWax Media. We are working with a steady stream of clients who are interested in enterprise eCommerce and ERP. The main client pain points we encounter are 1. a growing business outpaces an old system, or 2. business processes are more sophisticated than a limited e-commerce systems will support. At HotWax Media, it is our mission to make these pain points go away for our clients.

As we continue with our mission and the new year delivers a resurgence of tangible, budget-backed interest in enterprise e-commerce/ERP and OFBiz, I thought it would be useful to start building a list of some common questions our prospective clients face as they make their e-commerce/ERP purchase decisions. I plan to add to this list from time to time with subsequent blog posts. For now, we will begin with the following three common questions we have heard from sales prospects over the last month.

The answers here are meant to be relatively short and sweet. If you are looking for additional detail or are more generally interested in learning how HotWax Media can help you create or enhance your e-commerce/ERP system, contact us without delay!

1. What are my options related to product organization and display?

The first example today is related to product taxonomy and product content options. In this case, the sales prospect needed the ability to create quite a few categories, sub-categories, sub-sub-categories, and so on. She also needed the ability to deliver personalized content at each of these hierarchical levels based on user type. A competitor she had been speaking with was unable to support these requirements, so we were glad to be able to talk her down out of the tree (pun intended). The bottom line is that with OFBiz, you can create a product organization tree that has as many branches as you need to get the job done. There is no system-imposed limit to the number of categories you can create and use to organize and display your products in an OFBiz e-commerce storefront built by the OFBiz experts here at HotWax Media. Furthermore, you can deliver personalized content at any step along the way assuming you know who your user is (i.e. he has logged in or been somehow otherwise identified by the system). While you can personalize any product content at any step along the way, this capability requirement is especially common in B2B environments.

2. Can my system automate sales tax, payment processing, and shipping?

The short answer related to sales tax, payment processing, and shipping: No problem. A HotWax Media/OFBiz solution will empower you to handle sales tax, payment processing, and shipping however it will best suit your business. Sales tax is typically handled by 3rd party tax tables which provide sales tax requirement details all the way down to that specific split zip code you were wondering about in San Jose – no problem. Payment processing will generally be handled by one of the many integrations available out-of-the-box with OFBiz (PayFlow Pro, Authorize.net, Chase Orbital, etc.). In the event that you have a special requirement to use a different payment processor, the expert OFBiz developers at HotWax Media can implement a new payment processor integration in no time. Finally, with HotWax Media and OFBiz you will find a rich variety of shipping options from which to choose. These include integrations with USPS, FedEx, UPS, DHL, and many other shipping companies. The integrations also let you rely solely on automated quotes from the shipping companies, manual overrides, or a combination. With relative ease, you can control every aspect of your shipping revenue/expense related to your enterprise e-commerce storefront.

3. Can we do inventory management in this system?

Yes indeed, as a full-featured open source ERP framework, OFBiz offers great inventory management features that support everything from ATP/QOH-driven product display to inventory moves and re-order points. If your business is growing, you may already have and wish to integrate with an existing inventory management system. OFBiz makes that as easy as possible using XML-RPC, SOAP, or most any other common protocol designed for that type of synchronization. If you do not already have an inventory management system or are looking to replace the one you have, then you are in a great position to leverage the fully featured inventory management in OFBiz as part of an architecture that will already be integrated with your e-commerce storefront. Bonus!

Feel free to let us know if you have other common questions you would like to see addressed in this series, or contact us today to learn more about how HotWax Media can help you build and grow your e-commerce business.

Mike Bates is CEO at HotWax Media and will join other HotWax Media employees and advisors in periodically posting thoughts here related to OFBiz, eCommerce, ERP, and related topics.
Mike Bates - OFBiz Expert

HotWax Media and OFBiz – 2009 Contributions – Part 4

Monday, February 8th, 2010

For the final chapter in our series highlighting the contributions of HotWax Media to Apache’s Open For Business (OFBiz) in 2009, we will focus on the OFBiz integrations related components:

  1. Shipping Integrations
  2. Multi Channel Sales Integrations
  3. Payment Processing Integrations

Shipping

OFBiz Shipping USPS UPS

During 2009, the available shipping integrations in OFBiz got a boost from some much needed power users — clients with real-world business needs driving development efforts is always the best scenario for an open source project!  We focused on enhancing the integrations by implementing new aspects of UPS standard web services, UPS World Ship, USPS standard web services, FedEx and Endicia.

  1. Added UPS integration support for sending Shipment Return Label email to customer. This option will be available on order detail screen and as well on the return screen when order is in the “Completed” status and the return is in the “Accepted” status.
  2. Added functionality for getting online shipping charges from UPS if an order is in the “Approved” status with associated shipment in the “Picked” status and it has been hold due to an overage in the shipping charges from the Weight Package only screen.
  3. UPS integration enhancement for supporting shipping quote based on dimensions.
  4. Built a custom component for integrating OFBiz with existing UPS World Ship terminals.
  5. Added support for USPS international rate estimates and label printing.
  6. Built a custom component for integrating OFBiz with the Endicia services to provide additional features that were not supported in standard USPS web services.
  7. Built a custom component for integrating OFBiz with the new FedEx web services to provide additional features that were not supported by the version of the FedEx SDK that was currently utilized.

Multi Channel Sales

OFBiz Multi Channel

Over the past 10 years, possible sales channels have increased from catalogs and brick and mortar stores to include standard ecommerce, public marketplaces, and shopping comparison sites.  HotWax Media has played an active role in expanding the different multi-channel integrations that are offered to OFBiz users.  Here is a list of integration improvements to eBay, Google Base and Amazon:

  1. Added multiple store support to eBay and provided sample data to document how it works.
  2. As part of adding  multi-store support to the eBay integration, improved the Category Association management by adding  a new ProdCatalogCategoryType “PCCT_EBAY_ROOT” and adding a worker method in the CatalogWorker class to fetch the top level eBay categoryId.
  3. Implemented new services available in eBay – GetOrders and GetMyeBaySelling to allow single transaction (one per import) as well as multi transaction (multiple per import) support.
  4. Added a new screen to optimize the import orders and transactions workflow.
  5. Create support for eBay configuration from the new entity EbayConfig.  Provided the GUI support to update configuration values.
  6. Added a new entity, EbayShippingMethod, to support custom shipping methods from eBay. Also provided GUI support and included demo data for reference and documentation.
  7. Fixed the Google Base product feed – it was broken when we started working on it.
  8. Provide entity support for Google Base configuration.
  9. Updated eBay and Google Base customer error messaging.
  10. Added multiple store support to Google Base and provided sample data to document how it works.
  11. Built a custom component for integrating Amazon web services for: a) Sending product information (feeds for product, price, relationship, image, inventory) to Amazon;  b)Sending order adjustment and fulfillment information to Amazon; c) Retrieving order information from Amazon.

Payment Processing

OFBiz orbital google paypal

OFBiz flexibly integrates with a growing number of different payment processors.  2009 saw a number of new Payment Gateway options become available, and HotWax was able to provide updated or new integrations to many of these services.

  1. Implemented Chase Bank’s “Orbital Payment Gateway” – supported features are credit card authorization, capture, authorize and capture, release, and refund.
  2. Provided entity support for the configuration settings of Orbital Gateway – since this was created after the community switched to maintaining this in entities – property file configuration is not supported at this time.
  3. Analyzed the Google Checkout integration that was started in the OFBiz trunk – found it to be insufficient.  Provided a new implementation utilizing the updated Google Checkout SDK.
  4. Users can now create and order using Google Checkout – including the checking of existing customer information.
  5. Added support in OFBiz for fulfillment of orders created from inside Google Checkout.
  6. Added additional shipment, order state change, and other notifications into the Google Checkout integration.
  7. Provided seed & demo data so that user can test Google Checkout with merchant and seller accounts.
  8. Because this integration was stared when property files were used in OFBiz, we maintained backward compatibility to allow existing users to use property files for configuration settings in Google Checkout.
  9. Provided entity support for the configuration settings of Google Checkout per the current OFBiz standard.
  10. Added support to Google Checkout to support Google shipping methods in OFBiz.
  11. Added GUI support for GoogleCheckout entities to easily handle configuration settings. The name of entities are: GoogleCoConfiguration & GoogleCoShippingMethod.
  12. Provided documentation for the community to show how Google Checkout works.
  13. Made a number of improvements to the standard PayPal IPN integration.
  14. Implemented PayPal Express Checkout (both the Payflow Pro and standard PayPal account versions) allowing for order payments and refunds using a PayPal account.
  15. Provided entity support for the configuration settings of PayPal Express Checkout.
  16. Upgraded PayPal’s PayFlow Pro from version 2 to version 4 – helping the community to stay up to date while the existing implementation was deprecated and taken out of production in September of 2009.

What’s Next?

Spending our 2010 helping take the Apache Open For Business project to the next level of usability, flexibility, testability, and accountability.

Contact us today to learn how HotWax Media can help you achieve your business goals using Apache Open For Business.

- Tim

Tim Ruppert is Chief Operating Officer at HotWax Media as well as an OFBiz project committer and active community member. Tim will join other HotWax Media employees and advisors in periodically posting thoughts here related to OFBiz, eCommerce, ERP, and related topics.

This post is part of a 4 part series. Please find the other posts in this series here:

Read Intro | Part 1 | Part 2 |Part 3 | Part 4

OFBiz Tutorial – Building A Simple Product List Screen

Thursday, December 17th, 2009

In this post we will create our first simple html screen to print on screen all the products in our system.

This exercise is based on the “hwm” component we have setup in the last blog post OFBiz Tutorial – Custom Components In OFBiz: all the code we will implement will be contained in the custom component.

Here are the steps required to build the new screen:

  1. create a form definition for the list of products
  2. create a screen definition to include the form in a page
  3. create controller entries to associate the screen to a URL/address for the browser
  4. create a menu item to reach the new screen by clicking a link in a menu

All the steps we will do doesn’t require to compile/build OFBiz and can be done while OFBiz is running; in this way you will be able to test the effects of your experiments immediately.

Form widget definition for the list of products

A form widget definition is an xml representation of a list or single form.

In OFBiz, the main entity (aka database table) for storing product related information is named “Product”.

Here is the code to define a form of “list” type, together with the code to retrieve all the records from the Product entity and display them in a list based format:

The location of the file to edit

The location of the file to edit

1
2
3
4
5
6
7
8
    <form name="ListProducts" type="list">
        <actions>
            <entity-condition entity-name="Product">
                <order-by field-name="productId"/>
            </entity-condition>
        </actions>
        <auto-fields-entity entity-name="Product" default-field-type="display"/>
    </form>

Things to consider:

  • the type of this form is “list” because we want to render its content from a list in tabular format; the other main type for forms is “single” and it is used for rendering single forms (e.g. forms for data entry like “New Product”)
  • the commands under the “actions” section are executed just before the form is rendered; here we are using the “entity-condition” command to retrieve all the records from the “Product” entity sorted by “productId”
  • instead of specifying field by field all the fields to be rendered we have used the “auto-fields-entity” command; in this way all the fields from the Product entity are included as “display” (aka read only) fields

Screen widget definition for the list of products

A screen widget definition is an xml representation of a screen (page) in the application.

Here is the code to define a new screen that contains the form defined in the above step:

The location of the file to edit

The location of the file to edit

1
2
3
4
5
6
7
8
9
10
11
12
13
    <screen name="ProductList">
        <section>
            <actions>
            </actions>
            <widgets>
                <decorator-screen name="HwmCommonDecorator" location="component://hwm/widget/CommonScreens.xml">
                    <decorator-section name="body">
                        <include-form name="ListProducts" location="component://hwm/widget/HwmForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

Things to consider:

  • the action section of this screen is empty (we could safely remove the “actions” tags) because we have decided to run the data preparation (selection of all the records from the “Product” entity) in the form; both ways are fine: if the data retrieval logic is really tied to the form, it is a good idea to put it into the form’s action tag (reusing the same form in different screen will be just a matter of including the form in the screen definitions); if the data retrieval logic is dependent on the screen but you want to reuse the same form definition in more screens (for example one screen for different groups of products), then it is a good idea to implement it into the screen’s action tag, and then reuse the same form in all the screens; we will do this switch later in this post.
  • with the “decorator-screen” element we specify the name (”HwmCommonDecorator”) and location of a screen decorator: the screen decorator is used to decorate our screen with all the application menus, the header and footer that are shared by all the screens;
  • the screen specific content will go in the “body” section of the decorator, that is why we use the “decorator-section” element and add the screen specific content there; in this example, we have just added the form definition for the form created in the previous step
  • the path to the form widget definition is expressed in the format “component://<ofbiz component name>/<relative path to the form definition xml file>”; this format is widely used in ofbiz and it is useful because makes the system independent from the actual location of the ofbiz home folder and also enables the extension mechanism of OFBiz (we will talk about this in another post)

Controller entries – the url of our screen

Controller entries are needed to define the URL to reach the screen; for each screen you have to create two entries, a request-map and a view-map:

The location of the file to edit

The location of the file to edit

1
2
3
4
5
6
    <request-map uri="ProductList">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="ProductListScreen"/>
    </request-map>
...
    <view-map name="ProductListScreen" type="screen" page="component://hwm/widget/HwmScreens.xml#ProductList"/>

Things to consider:

  • in the controller.xml file all the request-map entries must be listed before the view-map entries
  • the request-map defines the URL of the screen for the browser; the “uri” attribute (”ProductList”) is the last part of the URL; the “security” element tells OFBiz to publish the page using the https protocol (https=”true”) and to grant access only to authenticated users (auth=”true”) (and redirect to the user login screen if a user is not already logged in); the end result is that the complete URL for the page will be: http://localhost:8080/hwm/control/ProductList
  • the view-map entry associates the “response” value defined in the request-map to the screen definition we have created in the previous step
  • there are many good reasons for decoupling the request-map to the view-map and this will be clearer when we will talk about events associated to user activities (e.g. form submissions)

Testing our work

If you have followed all the steps above you are now ready to test your work; no need to compile or restart OFBiz, just enter the following URL in your browser: https://localhost:8080/hwm/control/ProductList

You should see a screen like this: (Click on image to zoom)

OFBiz Product List

Things to consider:

  • all the fields of the Product entity have been automatically used as columns for the form list; the field names have been used to generate the column’s titles; all this happened because of the element “auto-fields-entity” we have used in the form definition
  • the framework has automatically decorated the form with pagination elements
  • all the records from the Product entity are shown, sorted by productId

A few simple experiments

Again, you can do all these changes without restarting OFBiz: just do them and reload the page after each and every change, this is a great way to explore the different options available.

The products are now sorted by productId in ascending order; if we want to sort them in descending order we just have to add the “-” symbol as a prefix of the field name in the “order-by” element of the “entity-condition”:

1
2
3
        <entity-condition entity-name="Product">
            <order-by field-name="-productId"/>
        </entity-condition>

if we want to sort by productTypeId and then productId:

1
2
3
4
        <entity-condition entity-name="Product">
            <order-by field-name="productTypeId"/>
            <order-by field-name="productId"/>
        </entity-condition>

If we want instead to filter all the product of type “finished good” and sort the result by productId:

1
2
3
4
        <entity-condition entity-name="Product">
            <condition-expr field-name="productTypeId" value="FINISHED_GOOD"/>
            <order-by field-name="productId"/>
        </entity-condition>

We can now add a label to the screen to explain that these are all the “finished products” in the system; in order to do this you will add a “label” element to the screen definition (see line 8):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    <screen name="ProductList">
        <section>
            <actions>
            </actions>
            <widgets>
                <decorator-screen name="HwmCommonDecorator" location="component://hwm/widget/CommonScreens.xml">
                    <decorator-section name="body">
                        <label text="Finished Products" style="h1"/>
                        <include-form name="ListProducts" location="component://hwm/widget/HwmForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

Adding a menu item for the new screen

Instead of typing the URL of our screen in the browser we want to add a link to it from the top level menu of the “Hwm” application.

Here is the code to do this (new code at line 3):

hwm-menus

1
2
3
4
    <menu name="MainAppBar" title="${uiLabelMap.HwmApplication}" extends="CommonAppBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
        <menu-item name="main" title="${uiLabelMap.CommonMain}"><link target="main"/></menu-item>
        <menu-item name="ProductList" title="Product List"><link target="ProductList"/></menu-item>
    </menu>

Things to consider:

  • the content of the “target” element must match the request-map name in the controller

Internationalization

In the last two paragraphs we have added two textual labels in English, one as a “label” element in the screen and the other as the “title” of the menu item. A better way of doing this, especially if you are interested in building internationalized applications that can be translated in many different languages, is to use the OFBiz i18n layer. In order to do this you have to add the following key in the component’s UiLabel file:

hwm-labels

1
2
3
4
    <property key="HwmProductList">
        <value xml:lang="en">Product List</value>
        <value xml:lang="it">Lista Prodotti</value>
    </property>

and then use the key instead of the hardcoded “Product List” string; for example for the menu item the code is:

1
        <menu-item name="ProductList" title="${uiLabelMap. HwmProductList}"><link target="ProductList"/></menu-item>

Moving the data preparation code from the form’s to the screen’s actions tag

We have mentioned before that the data preparation code can stay in the form’s actions section or in the screen’s actions section; in the first paragraph of this post we have implemented the code in the form; we now move it to the screen’s actions section:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
    <screen name="ProductList">
        <section>
            <actions>
                <entity-condition entity-name="Product" list="products">
                    <order-by field-name="productId"/>
                </entity-condition>
            </actions>
            <widgets>
                <decorator-screen name="HwmCommonDecorator" location="component://hwm/widget/CommonScreens.xml">
                    <decorator-section name="body">
                        <label text="Finished Products" style="h1"/>
                        <include-form name="ListProducts" location="component://hwm/widget/HwmForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

The entity-condition code is exactly the same with the only difference that now we have specified the “list” attribute: this is important because it represents the name of the variable that will contain the list of products selected; this name must match the same list-name attribute in the form definition that is now:

1
2
3
4
5
    <form name="ListProducts" type="list" list-name="products">
        <actions>
        </actions>
        <auto-fields-entity entity-name="Product" default-field-type="display"/>
    </form>

The “actions” section in the form is now empty and can be safely removed.

Homework

Now that we have the data preparation code in the screen, we can more easily implement an additional screen, that reuses the same form definition to list all the products of type “raw material” (productTypeId=”RAW_MATERIAL”): the implementation of the new screen, new controller entries, menu item, ui labels is a useful exercise.

Next steps

In the next posts we will explore some of the features of form widgets (and we will enhance our product list form) and we will see how we can implement a PDF and CSV versions of the screen.

- Jacopo

Jacopo Cappellato is VP of Technology at HotWax Media and has been involved with the OFBiz project since 2003. He is an OFBiz Project Committer and a member of both the OFBiz Project Management Committee and the Apache Software Foundation.
Jacopo Cappellato - OFBiz Developer - OFBiz Expert

OFBiz Tutorial – Custom Components in OFBiz

Tuesday, December 1st, 2009

This is the first of a series of posts that will introduce hands-on OFBiz development: each post will focus on a simple exercise that will unveil some of the powerful features of OFBiz.

In this post we will simply setup our sandbox environment: a custom component/application named “hwm” that is deployed in OFBiz and will contain our exercises.

OFBiz components

OFBiz Components

At its bare minimum, an OFBiz component is a folder, containing a special xml file, named “ofbiz-component.xml”, that describes the resources loaded and required by the component.
OFBiz itself is made up of components:

  • framework components: lower level components that provide the technical layer and tools to the application components; the features provided by these components are typically the ones provided by any other development framework (data layer, business logic layer, transaction handling, data source pools, etc…)
  • application components: they are generic ERP applications that can be used as they are or extended/customized (product, order, party, manufacturing, accounting etc…); application components have access to the services and tools provided by the framework components and to the services published by other application components
  • special purpose components: similar to the application components, the are special purpose applications like ecommerce, Google Base integration, eBay integration etc…
  • hot-deploy components: this folder is empty and it is where you can place your custom components; custom components have access to, and can extend/override, the resources published by all the other components

Prerequisites

  • JDK 1.6 is properly installed and the JAVA_HOME environment variable is correctly set; you can download Java from java.sun.com
  • an svn client is installed in your system (needed to checkout the latest OFBiz sources); you can freely download an svn client from tigris.org

Setting up the sandbox

These are the simple steps to download and build OFBiz and your custom component:

  1. Download the OFBiz source files from the official OFBiz SVN Respository (this step can take some time and requires access to the Internet): “svn co http://svn.apache.org/repos/asf/ofbiz/trunk ofbiz”
  2. go to the newly created folder: “cd ofbiz”
  3. run the ant task to create a standard OFBiz component: “./ant create-component” (and answer the questions when prompted, see below for details)
  4. build OFBiz and load the demo data: “./ant run-install”
  5. run OFBiz: “./ant run”

In short, here are the commands you have to type in a shell:

1
2
3
4
5
6
7
8
9
10
svn co http://svn.apache.org/repos/asf/ofbiz/trunk ofbiz
cd ofbiz
./ant create-component
      Component name: hwm
      Component resource name: Hwm
      Webapp name: hwm
      Base permission: HWM
      Confirm: Y
./ant run-install
./ant run

Now OFBiz and your custom applications are up and running; just point your browser to: http://localhost:8080/hwm
Login into the custom “hwm” application with username “admin” and password “ofbiz”.

More about the “create-component” script

Even if you can of course manually create an hot-deploy component, running the ant task “create-component” is the preferred way of starting with a new hot-deploy component because it is quick and generates a component layout that follows all the OFBiz best practices, enabling you to use and extend the existing OFBiz goodies:

  • entities (the data model)
  • services (business logic)
  • widgets (user interface elements like screens, forms, menus)
  • security (authentication and authorization)
  • localization
  • tools
  • etc…

The main advantage of using this development strategy is that all your custom code will be separated from the official OFBiz code, drastically simplifying the task of keeping your custom application updated with the new OFBiz versions. You will still be able to extend/override/customize specific OFBiz entities, services, screens and of course add new ones, just writing code into your custom component.

For the most curious of you, here are some details about the meaning of the questions asked by the “create-component” script:

  • component name: this is the name of the component (and also of the folder that will contain it, created in the hot-deploy folder); following OFBiz’s naming conventions, it should be a single word all lowercased (e.g. hwm)
  • component resource name: it will be used as a prefix for resources; you can just use the component name, possibly using an upper case character for the first character in the words (e.g. Hwm)
  • webapp name: this is the name and uri of the application in which the ui for the new component will be implemented; following OFBiz’s naming conventions, it should be a single word all lowercased (e.g. hwm)
  • base permission: this is the prefix for base security permissions; following OFBiz’s naming conventions, it should be a single word all uppercased (e.g. HWM)

Based on the answers provided, the script will setup a new component in the “hot-deploy” folder, with the following layout:

The layout of the custom component "hwm"

The layout of the custom component "hwm"

You may already recognize how the information collected from the user by the script has been used to generate the component.

Exploring the component layout

Now we have everything we need to start to practice with the development based on the OFBiz framework. In the upcoming posts we will use this component to perform some exercises that will help us to better understand how OFBiz works and how to use it to build powerful erp applications.

- Jacopo

Jacopo Cappellato is VP of Technology at HotWax Media and has been involved with the OFBiz project since 2003. He is an OFBiz Project Committer and a member of both the OFBiz Project Management Committee and the Apache Software Foundation.
Jacopo Cappellato - OFBiz Developer - OFBiz Expert