This chapter contains the following sections:
There are three basic types of objects in the display profile: channels, providers, and properties. Every object in the display profile is associated with a DN. The channels, providers, and properties display profile objects are used to group other display profile objects. These grouping objects are loosely referred to as “bags.” These bags add more structure to the display profile XML documents.
A channel object represents a single display element. The objects contained by a channel object can be thought of as properties for the channel. The channel definition includes a symbolic reference to the provider. You only need to include channel-specific properties when the provider defaults are not appropriate.
<Channel name="SampleXML" provider="XMLProvider"> <Properties> <String name="refreshTime" value="600"/> <String name="title" value="XML Test Channel"/> <String name="description" value="This is a test of the XML Provider system"/> <String name="url" value="file:///var/opt/SUNWportal/portals /<portal_id>/desktop/ default/SampleXML/getQuotes.xml"/> <String name="xslFileName" value="/var/opt/SUNWportal/ portals/<portal_id>/desktop/ default/SampleXML/html_stockquote.xsl"/> </Properties> </Channel>
A container object is identical to a channel object, except that it primarily generates its content by aggregating the content of other (its child) channels. A container object allows for available and selected channel lists and can contain leaf channel definitions. A leaf channel is typically aggregated on a page with other channels and generates its own content. A container channel primarily generates content by aggregating the content of one or more leaf channels. Both leaf and container providers are building blocks in that they can be extended (through their public interfaces) to create new or custom providers.
<Container name="JSPTableContainer" provider="JSPTableContainerProvider"> <Properties> <String name="title" value="JSP Based Table Container Channel"/> <String name="contentPage" value="toptable.jsp"/> <String name="description" value="This is a test for front table containers"/> <String name="Desktop-fontFace1" value="Sans-serif"/> <Collection name="categories"> <String value="Personal Channels"/> <String value="Sample Channels"/> <String value="News Channels"/> </Collection> ... </Properties> <Channels> ...leaf definitions go here...</Channels> </Container>
The provider is a programmatic entity responsible for fetching and displaying content in a channel. The XML tag for defining a provider object is <Provider name=“providerName” class=“providerClass”>.
The display profile stores provider definitions that are available to the channel and containers to implement their content generation behavior. The display profile provider definition contains the information necessary for a client of the display profile to construct the provider object, namely, the Java class name. The class that implements the provider’s behavior is defined in the provider attribute. Channels use the name attribute values to refer to the provider.
The provider definition sets default property values for all channels that point to this provider. Channel-specific properties are only necessary when the provider defaults are not appropriate. The provider display profile object should contain default values for all properties that are used in the provider Java object. For example, if the provider Java code contains:
the provider display profile object should have a default value for color.
<Provider name="XMLProvider" class="com.sun.portal.providers.xml.XMLProvider"> <Properties> <String name="title" value="*** XML Provider ***"/> <String name="description" value="*** DESCRIPTION ***"/> <String name="width" value="thick"/> <String name=”color” value=”blue”/> <String name="refreshTime" value="0" advanced="true"/> <Boolean name="isEditable" value="false" advanced="true"/> <String name="helpURL" value="desktop/xmlchann.htm" advanced="true"/> <String name="fontFace1" value="Sans-serif"/> <String name="productName" value="Sun Java System Portal Server"/> <String name="url" value="file:///var/opt/SUNWportal/portals/<portal_id>/ desktop/default/xml/getQuotes.xml"/> <String name="xslFileName" value="html_stockquote.xsl"/> <Integer name="timeout" value="100"/> <String name="inputEncoding" value="iso-8859-1"/> <String name="urlScraperRulesetID" value="default_ruleset"/> <Boolean name="cookiesToForwardAll" value="true"/> <Collection name="cookiesToForwardList"> </Collection> </Properties> </Provider>
Like display profile objects are grouped within their appropriate XML tag pairs. That is, providers are grouped within <Providers></Providers> tags, channels within <Channels></Channels> tags, properties within <Properties></Properties> tags.
Because you can have multiple display profile documents defined at different LDAP nodes, at runtime, the system merges these multiple display profile documents to deliver a particular Desktop to the user. This process of merging display profile documents affects the final display profile object values.
At runtime, the system never asks for properties directly from a provider. The request always goes to a channel. If a Java provider object requests a property, it searches the display profile in the following order until it finds the property, or until it reaches the top of the containment hierarchy:
Channel’s provider’s properties
Channel’s parent’s properties
Channel’s parent’s provider’s properties
Channel’s parent’s properties (and so on)
The global properties bag defined in the display profile root definition
Therefore, when a channel asks for the names of its properties, it gets the set of the union of all the above.
Properties that exist in a provider object are intended to have the semantics of default values for the channel. For example, for a provider XML that defines property title, all channels that are derived from provider XML inherit the title property. If the channel wants to override this property, it can set the value within its own properties.