Legacy Mac OS X Reference Library Apple Developer Connection

WOComponent HTML File Format

Availability

Available in WebObjects 5.4 and later.

This article describes the HTML file format of a WOComponent that is loaded by WebObjects applications. WOComponent objects are fundamental to how dynamic content works in WebObjects. You use components to represent webpages or partial webpages generated by your website. Components are actually templates for generating HTML pages. Components are constructed from static and dynamic elements. You use dynamic elements to bind HTML counterparts to variables and methods in your component class.

This format integrates the functionality of all the files contained in the original WOComponent bundle into a single HTML file. The file must be XML compliant with WOComponent references and bindings defined inline as tagged attributes. For example, <webobjects name="titleString"></webobjects> is represented as <wo:WOString value="[item.title]"/> in the XML format. The file can have an .html, .xhtml, or .xml file extension.

This format also supports dynamically generated elements within non-WebObjects tags such as <td align="top" width="[width]" ...... >......</td>. The td tag is translated into a WOGenericContainer using the [width] variable. Adding arguments to this dynamic element can be accomplished by adding specially prefixed key value attributes to the element. Specifically, the ?key="value" binding in the original bundle is represented as woq:key-"value" in the HTML file.

Listing 1 shows an example of this format for representing a WOComponent. The following sections describe the details of this format.

Listing 1  Example WOComponent HTML file format

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns:wo="http://www.apple.com/>
    <head>
        <meta name="generator" content="WebObjects 5.4">
        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
        <title>Think Movies : Home</title >
    </head>
 
    <body>
        <div>
        <wo:ToolbarComponent/>
        <br/>
        <br/>
        <br/>
        <wo:WOImage name="BannerImage" filename = "MoviesBanner.gif" height = "155" width = "563"/>
        </div>
    </body>
</html>
! icon

Warning: Apple reserves the right to modify the syntax and behavior of parsing the WOComponent HTML file format in future releases.

This HTML format is an alternative format to the original bundle format described in “WOComponent Bundle Format.”

WebObjects Namespaces and Tag Syntax

This section describes the syntax of WebObjects tags in the HTML file format. The syntax is as follows:

<wo:[component name] [woq:]attribute="[[^][binding value]]| binding value" ... />

This syntax has the following properties:

For example, this is how a WOHyperlink is defined in the original WOComponent bundle format:

Hyperlink1: WOHyperlink {
    ?movieID = movieID;
    directActionName = "DisplayMovie";
}

In the HTML file format, it is defined as follows:

<wo:wohyperlink woq:movieID="[movieID]" directActionName="DisplayMovie" />

Dynamically Resolved Non-WebObjects Tags

This section describes the syntax of non-WebObjects tags that contain dynamic elements. The syntax is as follows:

<entity attribute="[value] | value" [woq:]key="value" attribute="value1"......./>

This syntax has the following properties:



Last updated: 2008-11-19

Did this document help you? Yes It's good, but... Not helpful...