Shared zones - tooltwist/documentation GitHub Wiki

Shared zones are a new type of zone widget that can be used to replace traditional zone widgets on large sites.

A common problem for large sites can be that a single zone widget for header or footer is used by a very large number of pages. If one of the zones is modified, then all those pages will be changed and will need to be redeployed.

The FIP protocol is designed to be incremental, however changing a widely used zone in this case can result in virtually every JSP file being redeployed. In a site with thousands of pages and a large number of production servers, this can take a long time.

The solution to this problem is to use a Shared Zone widget, which is similar to a regular zone except that the generated code for the zone is placed in it's own JSP file, which is then included in each page that uses the zone.

Restrictions

There is one restriction on the way shared zones are used: since the zone code is not generated individually for each page where the zone is used, the zone will look exactly the same every time. In particular, widgets that reflect the current page's navpoint such as breadcrumbs and menus that highlight the current page, will not work correctly.

Using Shared Zones

Shared zones are created in the same way as regular zones, from the File->New... menu. Similarly they are placed on pages the same way as regular zones, by simply dragging and dropping.

A shared zone will have a navpoint automatically created, similarly to ajax zones, under the shared zones navpoint group. If this group does not already exist, add it in the designer alongside the existing ajaxZones group, then update the navpoint definition file by hand to change the navpoint id to sharedZones.

<navpoint>
  <id>sharedZones</id>
  <newId>xxxxx</newId>
  <type>group</type>
  <label>Shared zones</label>
</navpoint>

Don't forget to restart the server.

Converting a regular zone to a shared zone

To convert an existing zone widget to be a shared zone widget, edit it's conf.xml, from this:

<widget>
  <widgetClass>tooltwist.wbd.ZoneWidget</widgetClass>
  ...
</widget>

to this:

<widget>
  <widgetClass>tooltwist.wbd.SharedZoneWidget</widgetClass>
  <linkedWidget>toolbox.sharedZone</linkedWidget>
  ...
</widget>

Restart the server, then:

  1. Make any small change to the zone, and it will cause the navpoint for the shared zone to be created.
  2. Generate the navpoint for the shared zone, found under the Shared Zones navpoint group.
  3. Generate all pages that use the zone.

The pages should then work as usual, but using the shared zone. Remember that any time the zone is changed, it's navpoint must be regenerated.

--

⚠️ **GitHub.com Fallback** ⚠️