Versions Compared

Key

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

...

 Written by: Pranay Pandey With with feedback and contributions from Chirag Manocha, Ravindra Mandre, Rob Schapper
 Special thanks to Mridul Pathak for inspiring me to write this tutorial. 

...

Step - 1 : Create the sub - directory in hot-deploy/ and name it "practice"(hot-deploy/practice). The directory name should match the new components name that we are creating.

Note : Remember all customised development is done at this place only. 

Step - 2 : Create the ofbiz-component.xml file on path hot-deploy/practice and place following content in it (for reference you can check this file in any other component of OFBiz):

...

Step - 4 : Show labels in screens above the form like "New Person -- - Simple Event"  and  "New Person -- - Java Event" so that it will be easy to identify the purpose of that form.

...

Step - 2 :  Now you have to create a file by name "eecas.xml" in "entitydef" directory, which will be in your component directory "practice". Eeca definition will come here. (Take reference from eecas.xml of "accounting" component). This will be :

    <!- - To create party role whenever a party is created -->
    <eca entity="Party" operation="create" event="return">
        <condition field-name="partyId" operator="is-not-empty"/>
        <action service="createPartyRoleCustomer" mode="sync"/>
    </eca>

...

Note : Now the time is to define the group service. We will be defining the group service for the services which we have implemented for this practice application.

Step - 4 3 : You will be defining the service group in services.xml file.(Take reference from services.xml of party component).

...

 Create a group service by name "partyGroup" like :

<!-- Group service -->
    <service name="partyGroup" engine="group" auth="true">
        <description>Creates a party, person and party role Client</description>
        <group>
            <invoke name="createPracticePerson" result-to-context="true"/>
            <invoke name="createPartyRoleClient"/>
        </group>
    </service>

...

Step - 2 : Create new screen, form and service for creating a person. Here service will implement the interface. (For creating interface take reference from services_fixedasset.xml of accounting component) it will be like :

<!-- Peson Interface -->
    <service name="createPersonInterface" engine="interface" location="" invoke="">
        <attribute name="firstName" mode="IN" type="String" optional="false"/>
        <attribute name="middleName" mode="IN" type="String" optional="true"/>
        <attribute name="lastName" mode="IN" type="String" optional="false"/>
        <attribute name="suffix" mode="IN" type="String" optional="true"/>
    </service>
   
    <service name="createPracticePersonInterfaceService" engine="simple" location="org/hotwax/practice/PracticeServices.xml" invoke="createPracticePersonInterfaceService" auth="false">
        <description>Creates a new Person</description>
        <implements service="createPersonInterface"/>
        <attribute name="partyId" mode="OUT" type="String" optional="false"/>  
        <override name="suffix" optional="false"/>
    </service>

...

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

Conclusion:

If you have followed all the steps and developed practice application from this application then this will really help you in understanding other implementations in OFBiz. These things are basic foundation of working in OFBiz. Now you know that how you can start the development in OFBiz. Don't leave the extra links provided in this tutorial as they will really help you a lot in understanding the things which are there. Parallaly with the development of this application you can watch OFBiz videos which are available at Framework Introduction Videos.

Here is another good reading will be help you a lot is available at FAQ Tips Tricks Cookbook HowTo 

Now the next thing comes in mind is the business process which is really needed to work on, so for this books are available at : http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Related+Books\\Image Added