Versions Compared

Key

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

...

Info
titleImportant!

This tutorial is intended to be used with the latest SVN revision. It will not work with Release 4.

You  You can watch OFBiz videos, which are available at Framework Introduction Videos, in parallel with the development of this application.

...

Code Block
<resource-loader 	name="main" type="component"/>

 3. In <webapp> tag, we have different attributes and their purpose is as follows:

Code Block
<webapp name="practice"
       title="Practice"
       server="default-server"
       base-permission="OFBTOOLS"
       location="webapp/practice"
       mount-point="/practice"
       app-bar-display="false"/>

...

Step - 4 Create a file named "web.xml"(web.xml follows j2ee webapp specs). Contents of this file can be taken from any of the existing component e.g. example component. The Important values to change are the <display-name>, the localDispatcherName, and the mainDecoratorLocation.

    

Code Block
    <context-param>
                 <param-name>localDispatcherName</param-name>
             <param-value>practice</param-value>
                 <description>A unique name used to identify/recognize the local dispatcher for the Service Engine</description>
        </context-param>   
      
        <context-param>
                 <param-name>mainDecoratorLocation</param-name>
                 <param-value>component://practice/widget/CommonScreens.xml</param-value>
                 <description>The location of the main-decorator screen to use for this webapp; referred to as a context variable in screen def XML files.</description>
        </context-param>

For now put the value: "component://practice/widget/CommonScreens.xml" in for the location and you will see why in a while. This location is used in pointing to the main decorator location in screens like

...

. Which increases the code Independence from changing the path at many places when we need to change the main decorator location. At that time we just need to change the location there only and will work for all the screens where it has been used. One more advantage of doing this in screens is the purpose of resuability of existing screens which we can use from other components, but it decorate that screen by your decorator only as the same pattern is used at all the places and in all the components to show the mainDecoratorLocation. Concentrate on this when you add decorators in your screens in not too distant future with the development of this application.
Step - 5 Create a file named "controller.xml" (used by ofbiz webapp controller)  This file will be small and simple at first but will grow as we add functionality later on. For now insert the following code:

...