|
Segments primarily allow the division of pages into sections that could be enabled/disable or made visible, using logic at runtime. The logic is referred to as behavior-logic, in dWebSpec term. Example of segment entries are shown below.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Customer Statement</title>
</head>
<body>
<h1>
<!-- aws:segment id="Statement" type="inline" -->
. . . elements
<!-- /aws:segment -->
</h1>
<p>
<!-- aws:segment id="DebtorsNotice" type="inline" -->
. . . elements
<!-- /aws:segment -->
</p>
</body>
</html>
This would be reflected as segments in the descriptors; the debtors segment used the expression that allows it to show when a customer owes.
SEGMENT DESCRIPTORS |
id |
type |
visible |
enable |
valuue |
base-page-id |
extends |
event-id |
description |
| Statement |
inline |
|
|
|
|
|
|
|
| DebtorsNotice |
inline |
{bb.owed > 0> |
|
|
|
|
|
|
Unlike character stream based platform that arbitrary demarcations could be placed on the page, the division of a page into segments is more streamlined on the component based platform.
The division of the page would be along the lines of panels, containers, includes, etc. This is a common concept behind components, and having components that are containers, that could contain one or more other components.
This does not concern intrinsic page demarcations like table, row <tr> or cell <td>. What is in question is the demarcation of page for the purpose of dynamic behavior applications; those intrinsic demarcations must be implemented with their Web Control equivalent, in order to utilize server behaviors.
dWebSpec defines some segment types. These correspondences are shown below. The last three segment types are called the include type; they are the subject of discussion of the next section.
dWebSpec segment |
type |
ASP.NET |
<table> |
inline |
asp:Table |
<theader> |
inline |
|
<tbody> |
inline |
|
<tfooter> |
inline |
|
<frame> |
dynamic-include |
|
<iframe> |
dynamic-include |
|
<div> |
inline |
asp:Panel |
<row> |
inline |
asp:TableRow |
<td> |
inline |
asp:TableCell |
<layer> |
inline |
|
aws - inline |
|
|
aws - static-include |
static-include |
|
aws - dynamic-include |
dynamic-include |
|
aws - insert-include |
insert-include |
* |
* These items are discussed further below.
There are other ASP segments, like ItemTemplate, that are nested within components. These are discussed in the presentation of the various in-build components that ASP.NET offers.
For the purpose of behavior application, segments have the following attributes.
Segment Attribute |
ASP.NET Container Attribute |
visible |
Visible |
enabled |
Enabled |
Segment Reuse
Further discussion on insert-include and dynamic-include now follows.
Segment reuse has two forms. 1) The master or template page that has segment defined within that could be overridden or replaced. Pages would use these templates and override them as appropriate. Any page could be a template, it is the segments of the “insert” type that would delineate a segment as override-able. It is within the page descriptor that a page could indicate what page it is using as a template.
2) Another means of re-use is to include dynamically or statically other pages. For specification of segment to include, dWebSpec provides two attributes a) the base-page-id that indicate the page the segment reside, and b) extends that carries the segment-id to include.
ASP.NET has facilities for static include, which is discussed on segment types. There is no support for dynamic include as specified by dWebSpec. What is available is User Controls, that allow design of complex components that could include both segments and elements.
AJAX
All the segmentation and segment reuse discussed above, have to do with initial rendering or re-rendering on post-back, for the page. There is partial-rendering involving AJAX. This has gained popularity in making web application appear highly interactive, on the level of desktop applications.
To mark a segment for partial-rendering, all that is needed is to include an event-id entry for the segment. This id would belong to the AJAX event descriptor entry.
The subject of AJAX is discussed under the event descriptor, and event-id specification of this descriptor.
More details are available in the attributes descriptions id type value event-id visible enabled base-page-id extends description |