Versions Compared

Key

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

...

       <!-- Request Mappings -->

       <request-map uri="main"><security https="false" auth="false"/><response name="success" type="view" value="main"/></request-map>

       <!-- end of request mappings -->

       <!-- View Mappings -->

       <view-map name="main" type="screen" page="component://practice/widget/PracticeScreens.xml#main"/>

       <!-- end of view mappings -->
</site-conf>

Step - 6 : Move up one level and create a new directory named 'error'(hot-deploy/practice/webapp/practice/error).

...

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.

...

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

...

Code Block
<target name="classpath">
    <path id="local.class.path">
        <fileset dir="../../framework/base/lib/j2eespecs" includes="*.jar"/>
    </path><path>
</target>


This will needed for the classes like

...

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>

...

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 :

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>

Here we are implementing an interface and overriding the behaviour of the attribute "suffix", which will have effect when this service will be in action.

...

Code Block
<extend-entity entity-name="">
        <field name="" type=""/>
    </extend-entity>


This is the simplest form it can be more complex. This will add up one more field to the entity you already have. Now it depends which field you want for your custom needs. Here you can also defined relation of this field with other entities you want. But before doing this you should search extesively may be you will be adding a field for a purpose and there is already a field which will serve the purpose, so be concisous about this. Also go for a extensive study of data model then do this.
 

...

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 Modified