dWebSpec Dictionary
CONTEXT: descriptors->segment




All Details Standard Only Platform Only
Structured Web info and helpTechnologies
 Home Page
 Product Page
 Download Page
 Feedback
Javascript Tree Menu

Results for:

 segment 
Prev  Topic  Next

One of the facilities provided by dynamic web platforms is the ability to divide pages into sections or segments. These segments could then be dynamically arranges, selectively shown or hidden, enabled or disabled. There are also the issue of re-use of segment; one copy used in many places. There is also some form of inheritance; adding to a base segment, or enhancements based on runtime parameters.

With AJAX comes the possibility of segments being targets for re-rending, partial refresh, etc.

All these activities are captured by the segment descriptor.

Page Segmentation

Segments could be of two flavors. 1) Component based: on some platforms all elements are part of component tree. As such, a segment, which is a component itself, would be a container component. On such platform, a segment could have identity or server side representation.

2) Character stream based: on such platforms, we are simply generating character streams, of HTML or xHTML syntax. For these we could arbitrarily demarcate the page any way desired, as long as the active tags used to render the page remain valid XML. When such demarcations are done, it is possible for the dynamically assembled page to become invalid HTML/xHTML.? For example, with starting <div> tag, and no ending </div> tag. This would be a concern during the demarcation exercise, but there are no restrictions that preclude this. This is less likely for component based architecture, because of the component hierarchy.

Segment Reuse

Apart from the breaking of page into segments, there is another issue of pages that are made up of other pages. This allows the reuse of common fragments by multiple pages. This feature could vary from simple inclusion of segments, to full templates whereby a common theme or page is defined, which part of it could be replace or customized in the composition of pages.

dWebSpec provides the scheme for capturing the reuse of segments as provided in the state of the art frameworks and template utilities. The full implications of this aspect could be realized from the descriptor attributes, also a full discussion on page reuse is provided in the Introduction and Guide.

As an overview, the following facilities are provided for. 1) The include facilities, which allows inclusion of fragments from other pages. 2) The template facilities, that allows the use of a template or master page in composing pages.

 Struts 1.x  

Page Segmentation 

In essence Struts is of the character stream type. For Struts, there is no container or component hierarchy that would represent the segment. These demarcations are arbitrary; as such, when a segment of a page is demarcated into a segment as shown below.

  <!--aws:segment id="actionEqualNew" -->
  . . . . Code for Create . . . .
  <!--/aws:segment -->
  

There is no server side, or page representation of this segment. The only way this demarcation could be meaningful by itself, is if such segments is part of the template scheme. But, taken as a sole definition, it would be of no implementation implications.

One of the primary reasons to define segments is to allow application of dynamic behaviors to the segments. It is this application of dynamic behavior that would have implementation consequences on the Struts platform.

Example of segment entry is shown below.

SEGMENT DESCRIPTORS

id

type

visible

enable

valuue

base-page-id

extends

event-id

description

actionEqualNew inline logic-x            

"logic-x" represented above, would be specified in the behavior descriptor and mapped to logic tag at implementation time.

The implementation on the Struts, for behaviors, involves the enclosure of the segment with logic tags, as shown in the listing below.

   <logic:x>
   <!--aws:segment id="actionEqualNew" -->
   . . . . Code for Create . . . .
   <!--/aws:segment -->
   </logic:x>
   

Segment Reuse

Unlike the segmentation in general, segment re-use and templates, have implementation consequences.

Some of these implications are in the discussed for the type attribute of the segment descriptor. Furthermore, the subject of templates is covered under page descriptor?s template attribute.

More details are available in the attributes descriptions id type value event-id visible enabled base-page-id extends description
Prev Next