Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This document is meant for OFBiz  beginners. It will help to come up with the most basic knowledge of OFBiz application development process. Aim behind the creation of this tutorial is to acquaint a developer with best practices, coding conventions and the control flow and many more.

Note - 1 :- For any additional query and concern you can consult to Example component. You will always find the code in example component to be the most latest code of OFBiz. Take reference whenever you want to see some sample code for the development of this application.
Every new feature is first added in the Example component for the references.
Note - 2 : Before starting the development of this application you must read the contents form :
            http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practiceshttp://docs.ofbiz.org/display/OFBADMIN/Coding+Conventions and http://docs.ofbiz.org/display/OFBADMIN/Best+Practices+Guide

...

Note - 4 : For searching any of the document the best place is at : http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Documentation+Index .   

Part - 1  

Create first basic application by name "practice" :

...

Step - 11 : Now create a file in webapp directory "practice" by name index.jsp (Contents of this file can be taken from "example" component), this file is responsible for redirecting the response to control/main if you give url  http://localhost:8080/practice/ and if you give url like http://localhost:8080/practice/unknown/requestit will be redirected to the redirectPath specified in web.xml. In that case, ContextFilter filter out the request and use this redirect path to redirect the request.

Part - 2


Doing some advancements :

...

Code Block
<property key="PracticeApplication">
    <value xml:lang="en">This is first 	practice</value>
</property>
<property key="PracticeCompanyName">
    <value xml:lang="en">OFBiz: Practice</value>
</property>




Step - 3: Include this Ui UI Label resource in your main decorator screen which you created earlier and use these one or two ui labels which you are having now.

...

Note : Always search first for any existing Ui label in ofbiz and if you don't find it there then only create new one.

Now its time to make this practice application secure by checking authentication (user login):

...

Note : Important point to note here is that the person 'Mr. THE PRIVILEGED ADMINISTRATOR' has a partyid admin has multiple logins as listed in the
User Name(s) form.
Step : 4 - We interested in the admin user login so click on the 'Security Groups' button and confirm that the use 'admin' is part of the 'FULLADMIN' group. The Groups that the user belongs to is shown in the bottom list form Drill down on the FULLADMIN.
Step : 5 - Click on the Permissions tab. This tab shows all the permissions for the FULLADMIN security group. Navigate between the permissions till you find the OFBTOOLS permissions.
'OFBTOOLS_VIEW Permission to access the Stock OFBiz Manager Applications.' This confirms that the userlogin 'admin' has the permission 'OFBTOOLS'
Step : 6 - Take a moment  to review the entity model as it relates to users and permissions. The arrow represents the many side of the relationship.An really important reading at this moment is at : OFBiz Security

Part - 3

Writing CRUD operations:

Create, Update and Delete operations for an entity will be done by services which we will be writing in minilang.

...

7.c : Now call service createPracticePerson service by passing out map which is obtained after processing fields as a in map to the service.

Part - 4


Java Event:

Here the java event which you will be writing will be fairly simple. For reference you can check any of the *Events.java file.

...

Don't forget to restart the server after this implementation.

Part - 5


Creating new entity:

 For the creation of new entity you can again take a referecne from example component for this you can have a look in entitymodel.xml file of example component. You can create new entities by following these steps:

...