Apache Components: Custom Components in Ofbiz | HotWax (2024)

Edit – First time this post was published in 2009 working with OFBiz trunk, updated it to work with OFBiz latest Release 16.11.

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

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

Apache OFBiz custom components

Apache Components: Custom Components in Ofbiz | HotWax (1)

At its bare minimum, an Apache 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

  • Java SDK 8 is properly installed and the JAVA_HOME environment variable is correctly set; you can download Java fromhttp://www.oracle.com/technetwork/java/javase/downloads/index.html
  • Apache Subversion® client is installed in your system (needed to checkout the latest OFBiz sources); you can freely download an svn client fromhttp://subversion.apache.org/packages.html.

Setting up the sandbox

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

  1. Download the OFBiz Framework 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/branches/release16.11 ofbiz.16.11”
  2. go to the newly created folder: “cd ofbiz-framework”
  3. run the Gradle task to create a standard OFBiz component/plugin: “./gradlew createPlugin -PpluginId=hotwax”
  4. build OFBiz and load the demo data: “./gradlew loadDefault”
  5. run OFBiz: “./gradlew ofbiz–start”

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

svn co http://svn.apache.org/repos/asf/ofbiz/branches/release16.11 ofbiz.16.11cd ofbiz.16.11./gradlew createPlugin -PpluginId=hotwax./gradlew loadDefault./gradlew ofbiz --start

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

More about the “createPlugin” script

Even if you can of course manually create a plugin, running the gradle task “createPlugin” is the preferred way of starting with a new custom 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 component/plugin you have just setup:

  • component name: this is the name of the component (and also of the folder that will contain it, created in the specialpurpose folder); following OFBiz’s naming conventions, it should be a single word all lowercased (e.g. hotwax)
  • 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. Hotwax)
  • 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. hotwax)
  • 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. HOTWAX)

The script will setup a new component in the “specialpurpose” folder, with the following layout:

Apache Components: Custom Components in Ofbiz | HotWax (2)

The layout of the custom component “hotwax”

You may already recognizehow the automated script for creating a new plugin has setup this OFBiz Component for you.

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.

Apache, Apache OFBiz, Apache Subversionare trademarks of the Apache Software Foundation.

DATE: Mar 22, 2017

AUTHOR: Jacopo Cappellato

OFBiz Tutorials, OFBiz Development, OFBiz Tutorial, OFBiz Components, OFBiz, Jacopo Cappellato, OFBiz Tutorials for Beginners

Apache Components: Custom Components in Ofbiz | HotWax (2024)

FAQs

What is the vulnerability of Apache OFBiz? ›

What is the vulnerability? There is an authentication bypass vulnerability in Apache OFBiz tracked under CVE-2023-51467 and CVE-2023-49070. Successful exploitation would let an attacker circumvent authentication processes, enabling them to remotely execute arbitrary code and access sensitive information.

What is the OFBiz component XML? ›

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

What is the use of Apache OFBiz? ›

Overview of Apache OFBiz™

It provides a suite of tools and applications to manage various business functions, including accounting, human resources, customer relationship management, order management, and manufacturing.

How to run Apache OFBiz? ›

Building and Starting OFBiz
  1. Extract the downloaded zip file.
  2. Open a terminal and navigate into the newly created directory.
  3. If you are using Linux enter the following at the command line. ./gradlew loadAll ofbiz. If you are using Windows then enter the following at the command line. gradlew loadAll ofbiz.

What database does OFBiz use? ›

Database Setup. The OFBiz package comes with Apache Derby, an open source Java database with DB2 specs and is based on the IBM Cloudscape product. This database is good for demonstration purposes because it is easy to setup and use.

Does Confluence use Apache OFBiz? ›

Jira DC uses Atlassian's fork of the Entity Engine module of the Apache OfBiz project. We use only the Entity Engine module, while the vulnerability is in the framework module. Confluence does not use the Apache OfBiz library and is not vulnerable to this vulnerability.

What is Apache component? ›

Components are a fundamental building block of Apache Camel and are used to connect routes to a wide variety of external systems and services. Camel comes with a large number of built-in components that provide connectivity to a wide range of technologies and protocols, such as HTTP, JMS, file, and many others.

Is Apache OFBiz free? ›

Yes Apache OFBiz is completely free. You can download and use it for free. You can find more details about the Apache 2.0 licence.

Which companies use Apache OFBiz? ›

Who uses Apache OFBiz?
CompanyWebsiteRevenue
Infosys Ltdinfosys.com>1000M
Home Depot Inchomedepot.com>1000M
Valtechvaltech.com>1000M
Cognizant Technology Solutions Corpcognizant.com>1000M
1 more row

What is the default username and password for OFBiz? ›

You can log in with the user admin and password ofbiz.

How do I restart my OFBiz service? ›

To check simply re-start OFBiz (Ctrl+C followed by "./gradlew ofbiz") and direct your browser to Entity Data Maintenance Tool here: https://localhost:8443/webtools/control/entitymaint and search for entities OfbizDemoType and OfbizDemo.

How to install Apache OFBiz on Linux? ›

Building and Starting OFBiz
  1. Extract the downloaded zip file.
  2. Open a terminal and navigate into the newly created directory.
  3. Enter the following at the command line: Linux: ./gradlew "ofbiz --load-data readers=seed,seed-initial" loadAdminUserLogin -PuserLoginId=admin. ...
  4. Check if OFBiz is started.

How do I stop OFBiz? ›

Force OFBiz shutdown

Terminate all running OFBiz server instances by calling the appropriate operating system kill command. Use this command to force OFBiz termination if the –shutdown command does not work. Usually this is needed when in the middle of data loading or testing in OFBiz.

What is the vulnerability of Apache guacamole? ›

0, Apache Guacamole used a cookie for client-side storage of the user's session token. This cookie lacked the “secure” flag, which could allow an attacker eavesdropping on the network to intercept the user's session token if unencrypted HTTP requests are made to the same domain.

What is the vulnerability of Apache Log4j? ›

Log4Shell (CVE-2021-44228, CVE-2021-45046 and CVE-2021-45105) is a remote code execution (RCE) vulnerability that enables malicious actors to execute arbitrary Java code, taking control of a target server.

What is the vulnerability of Apache 2.4 49? ›

A flaw was found in a change made to path normalization in Apache HTTP Server 2.4. 49. An attacker could use a path traversal attack to map URLs to files outside the expected document root. If files outside of the document root are not protected by "require all denied" these requests can succeed.

What is Apache Struts vulnerability? ›

Apache Struts Overview of CVE-2023-50164 and Analysis. Vulnerability Overview: The vulnerability allows an attacker to manipulate file upload parameters to enable path traversal, potentially leading to the uploading of a malicious file for remote code execution.

Top Articles
Latest Posts
Article information

Author: Kareem Mueller DO

Last Updated:

Views: 5779

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Kareem Mueller DO

Birthday: 1997-01-04

Address: Apt. 156 12935 Runolfsdottir Mission, Greenfort, MN 74384-6749

Phone: +16704982844747

Job: Corporate Administration Planner

Hobby: Mountain biking, Jewelry making, Stone skipping, Lacemaking, Knife making, Scrapbooking, Letterboxing

Introduction: My name is Kareem Mueller DO, I am a vivacious, super, thoughtful, excited, handsome, beautiful, combative person who loves writing and wants to share my knowledge and understanding with you.