Versions Compared

Key

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

...

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 - 3 : Dont Don't copy any file from other component, as the revision number for the file is also copied. Always create new file and if required then copy the contents of the file." Also be conscious about the unused code as well.

...

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 customized development is done at this place only. 

...

Step - 8 : Create a file inside the directory "widget" named "PracticeScreens.xml".
 Contents of this file can be taken from any of the existing component  e.g. example component.

As now onwards you will be able to create screens views so an important reading at this place will be Best Practices Guide .  On this page there links to following:

  • HTML and CSS Best Practices
  • Managing Your Source Differences
  • Methodology Recommendations
  • User Interface Layout Best Practices

All these readings will be really of help.
Very first screen will be like :

...

Code Block
public static String createPracticePersonJavaEvent(HttpServletRequest request, HttpServletResponse response){         
    LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");       
    GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator");
}

...

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>

...

 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>

...

Code Block
<!-- 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>

...

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 Removed