| PATH |

Rendering the Direct to Web Template
Now the WebObjects framework begins to render the template. Listing 3-4 shows excerpts from the HTML template for the BASQueryPage Direct to Web template; the listed portions of the file are discussed in this example. Listing 3-5 shows the corresponding sections in the bindings file.
First, the Direct to Web template displays the page wrapper.
To do so, it needs to resolve the WOComponentName binding for the
PageWrapper WOSwitchComponent (see Listing 3-5). A WOSwitchComponent
displays a nested component that has the name specified by its WOComponentName
binding, which in this case is bound to the d2wContext.pageWrapperName key.
Since the Direct to Web Context can't find it in its dictionary,
it invokes the rule engine to resolve the key, which fires the rule:
*true* => pageWrapperName = "PageWrapper"
The Direct to Web context returns "PageWrapper" for the
WOComponentName binding and the WOSwitchComponent displays the application's PageWrapper.wo component.
The template continues to render, resolving its keys in a similar
way.
<WEBOBJECT NAME=PageWrapper>
.
.
<WEBOBJECT NAME=ResourceRepetition>
.
.
... <WEBOBJECT NAME=ResourceLabel>: ... </WEBOBJECT>
.
.
<WEBOBJECT NAME=ResourceInputRepresentation></WEBOBJECT>
.
.
</WEBOBJECT>
</WEBOBJECT>
Listing
3-5 BASQueryPage.wod excerpts
PageWrapper: WOSwitchComponent {
WOComponentName = pageWrapperName;
...
}
ResourceInputRepresentation: WOSwitchComponent {
WOComponentName = d2wContext.componentName;
...
}
ResourceLabel: WOString {
...
value = d2wContext.displayNameForProperty;
}
ResourceRepetition: WORepetition {
...
item = d2wContext.propertyKey;
list = d2wContext.displayPropertyKeys;
}

© 2001 Apple Computer, Inc.