Portlet Factory, Version 6.1.2


 

About alternative XML representations

IBM® WebSphere Portlet Factory provides support for other XML object models and APIs with functionality called Alternative XML Representation (AXR).

AXR allows you to use and convert the following XML interfaces:

IXml

WebSphere Portlet Factory's interface for processing XML objects.

Document Object Model (DOM)

The Worldwide Web Consortium's interface for processing objects in an XML document.

JDOM

A Java-oriented interface for processing objects in an XML document.

In addition, AXR allows you to define your own XML interfaces by providing a Java class representing the XML document and extending the com.bowstreet.util.ObjectBuilder and com.bowstreet.util.ObjectWalker classes.

If you define your own XML interfaces, add an ObjectRepresentation element to the ObjectRepresentations.xml file in the WEB-INF/config directory. The following XML structure shows the ObjectRepresentation element for the example Address XML interface:

<ObjectRepresentation>
  <NamespaceURI>http://www.example.com/addresses</NamespaceURI>
  <TypeName>Address</TypeName>
  <ObjectClassName>com.bowstreet.examples.AlternativeXMLObject.Address</ObjectClassName>
  <ObjectBuilderName>com.bowstreet.examples.AlternativeXMLObject.AddressBuilder</ObjectBuilderName>
  <ObjectWalkerName>com.bowstreet.examples.AlternativeXMLObject.AddressWalker</ObjectWalkerName>
</ObjectRepresentation>

As a result of AXR functionality, you can set XML variables in your models to be either an IXml, DOM, or JDOM representation or a representation that you have created by developing a builder and walker for a class that represents some XML document.

 

About setting up your environment to use alternative XML objects

The Alternative XML Representation functionality requires that the .jar files containing a SAX parser and the DOM and JDOM classes be in the AutomationEngine classpath. Also, any builder and walker classes must be in the classpath. By default, the AutomationEngine loads any classes found in the nonservable_content_root/classes directory at startup and dynamically loads classes found in the nonservable_content_root/work/classes directory.

Parent topic: Overview: working with XML


Library | Support |