Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fixes link
Info
titleDeprecated

This feature had been removed by

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-5747

Table of Contents

Table of Contents

Related Documents

...

Documents

...

Introduction

The Regions Tool, or Framework, is an implementation of the Composite View pattern as described in various works on Enterprise Architecture Patterns and is based on the implementation presented in the book Advanced Java Server Pages by David Geary. You can get more information about this book on the Docs & Books page on the ofbiz.apache.org/ website.

...

Here is an example of a region definition that inherits from another definition:

    <define id='login' region='MAIN_REGION'>
        <put section='title'>Login Page</put>
        <put section='content' content='/login.jsp'/>
    </define>

This definition does not use the template attribute of the define tag. Instead it uses the region attribute and specifies the region that this region will inherit its base definition from. The same template as the parent region will be used and all of the put settings for assigning content to sections will be inherited. Any put tags specified in the inheriting region will override the section content assignments of the parent region.

...

Here is an example of a region that is meant to be used as content for a section in the main region. In order to use this a region that inherits from the main region is defined for this new style of page. Also included below is an example of a region that inherits from this new style of page and overrides the main content area and the title section so that it can be used as a real world view.

    <define id='LEFTBAR_REGION' template='/templates/leftbar_template.jsp'>
        <put section='first' content='/catalog/choosecatalog.jsp'/>
        <put section='second' content='/catalog/keywordsearchbox.jsp'/>
        <put section='third' content='/catalog/sidedeepcategory.jsp'/>
        <!-- <put section='fourth' content='http://www.yahoo.com' type="http"/> -->
        <put section='fourth' content='/catalog/minireorderprods.jsp' type="resource"/>
        <!-- <put section='fifth' content='/fifth.jsp'/> -->
    </define>

    <define id='LEFT_ONLY_REGION' region='MAIN_REGION'>
        <put section='leftbar' content='LEFTBAR_REGION'/>
    </define>

    <define id='showcart' region='LEFT_ONLY_REGION'>
        <put section='title'>Show Cart</put>
        <put section='content' content='/cart/showcart.jsp'/>
    </define>

...

 

Different Types of Sections

...

The first step for using the region render tag is to declare the use of the region taglib as follows in the JSP:

	<%@ taglib uri='regions' prefix='region' %>

The "regions" uri comes from a declaration in the web.xml file, which is done in the standard way.

That done you can specify where each section content will be inserted, or rendered, using the region:render tag as follows:

	<region:render section='header'/>

There are other tags in the region taglib that can be used just like the XML elements in the regions.xml file to define regions and the content that is assigned to each section in the region.