Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
|
Personalizing Data Display With XML: Portal-to-Go , 10 of 16
A Portal-to-Go Adapter retrieves content from the source. In the example illustrated here, it pulls specific quotes and headlines from a Web page. Then the Adapter converts the content to XML.
Why not go straight to the target device format? Two reasons: flexibility and extensibility. To go straight from source to target, you must effectively create an adapter and transformer for each source-target pair. With XML as an intermediate format, you only need one adapter for each source, and one transformer for each device. For example if there are, say two content sources and three target devices
Adapter output must be XML to be generic. The key is to define an XML document type that can represent any data type you might want to display on any device. The document type is defined by a Document Type Definition (DTD). A DTD is a file that provides a grammar for a class of XML documents by describing the elements it can contain.
To create a truly universal intermediate data format, Portal-to-Go uses the Simple Result DTD. Elements in the Simple Result DTD represent the elements of an abstract user interface. These include the following:
Figure 7-6 illustrates the Simple Result DTD content model.
Following is a portion of SimpleResult.dtd that shows the elements used in our Stock Data example.
<!-- Entity: "GENATTR" contains generic attributes for most elements. Attribs: "name" is the name of the element. "title" is the title of the element. ... --> <!ENTITY % GENATTR " name CDATA #IMPLIED title CDATA #IMPLIED ... "> <!-- Element: "SimpleResult" is the result element. Usage: This element contains the result. Children: "SimpleText" is a text result. ... --> <!ELEMENT SimpleResult ((SimpleContainer|SimpleText|SimpleMenu| SimpleForm|SimpleTable|SimpleImage|SimpleBreak)+)> <!ATTLIST SimpleResult %GENATTR;> ... <!-- Element: "SimpleText" for displaying one or more blocks of text. Usage: Used for plain text. Children: "SimpleTextItem" is a block of text. --> <!ELEMENT SimpleText (SimpleTextItem+)> <!ATTLIST SimpleText %GENATTR;> <!-- Element: "SimpleTextItem" is a block of text Usage: Holds one block of text - normally a single paragraph. Children: "#PCDATA" is the actual text. --> <!ELEMENT SimpleTextItem (#PCDATA)> <!ATTLIST SimpleTextItem %GENATTR;> ... <!-- Element: "SimpleForm" for displaying one or more input fields. Usage: As a data-entry form. Children: "SimpleFormItem" for each input field. Attribs: "target" is the link target for this form. "section" is the section identifier
***** A special case for the WIDL adapter *****
--> <!ELEMENT SimpleForm ((SimpleFormItem|SimpleFormSelect)+)> <!ATTLIST SimpleForm %GENATTR; target CDATA #REQUIRED section CDATA #IMPLIED> <!-- Element: "SimpleFormItem" is a single input item in a simple form. Usage: For getting input from a user. Children: "#PCDATA" contains pre-filled input from the server.
****** This overrides the default attribute. *******
Attribs: "default" provides a default value for optional fields.
***** The default value should only be used if the field is empty.
--> <!ELEMENT SimpleFormItem (#PCDATA)> <!ATTLIST SimpleFormItem %GENATTR; default CDATA #IMPLIED mandatory(yes|no) "no" maxLength CDATA #IMPLIED> ...
Portal-to-Go Adapters map the source content to the appropriate Simple Result element.
For example, Table 7-1 shows the XML for an input form (text label, input field, and submit button) and results page (ticker symbol, stock price, and headlines) generated by a hypothetical StockData Adapter.
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|