Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Tag Conversion Design

Revision as of 17:56, 8 January 2007 by Unnamed Poltroon (Talk) (Tag Conversion Factories)

Overview

This design note describes a proposed design for model view conversion from JSP/JSF tags to HTML in the Visual Page Designer. This document should be considered tentative and highly subject change.

The design-time render engine for the Visual Page Designer (VPD) is an HTML/CSS visual renderer. It relies on a transformed view of the JSP page model that approximates the HTML/CSS output that the real runtime servlet would generate to render a page. To accomplish the conversion of the design time model, the VPD uses the concept of a ITagConverter.

One or more factories is consulted to construct ITagConverter for each tag found in the source document. For each tag that has an ITagConverter constructed, transforming of the tag to the corresponding HTML is delegated.

Tag Converters

Tag converters are transformative adapters that create one-to-one mappings from source model tags to renderable HTML elements. Each converter may be thought of as a mapping function, f where:

f: Tjsp -> Thtml

where T is the set of all valid tags, Tjsp is the the subset of T containing only valid JSP source document tags and Thtml is the subset of T containing only valid HTML 4.01 tags. f is not guaranteed to be strictly bijective. However, given a fixed Tjsp, Gjsp (i.e. a specific JSP source document), the set Gf (the resulting HTMl document) will always have a bijective relationship to Gjsp. Thus, for any resulting HTML rendered tag, a reverse mapping to the source JSP tag should always be possible. Although a possible exception may occur with tags that use the Composition archetypes (see Archetypes below), since composed objects may involve generating multiple sibling HTML tags for a single JSP/JSF tag (for example, a tabbed panel).

While an extension-point based system is provided (see Factories below) for creation of customized tag converters, the preferred method of tag conversion is create transformation mappings through the use of meta-data. In this scenario, the following class structure is provided as the "workhorse" tag converter for doing most model adaption:


Tag Conversion Factories

Tag conversion factories create ITagConverters based on the type of tag that exists in the source model.

Transformation-based Tag Converters

Archetype-driven Transforms

Back to the top