org.openeai.implementations.layouts
Class XpathLayout


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.layouts.EnterpriseLayoutManagerImpl

              |

              +--org.openeai.implementations.layouts.XpathLayout

All Implemented Interfaces:
EnterpriseLayoutManager

public class XpathLayout
extends EnterpriseLayoutManagerImpl
implements EnterpriseLayoutManager

A Class class.

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
XpathLayout()
          Constructor
 
Method Summary
 void buildObjectFromInput(java.lang.Object input, XmlEnterpriseObject xeo)
          Method used to build an object from an input.
 java.lang.Object buildOutputFromObject(XmlEnterpriseObject xeo)
          Method used to serialize an object to some output.
 java.lang.Object buildOutputFromObject(XmlEnterpriseObject anXmlEnterpriseObject, java.lang.String appName)
          Method used to serialize an object to some output for a particular application.
 void init(java.lang.String layoutManagerName, org.jdom.Document layoutDoc)
          Method used to initialize the LayoutMangager implementation with information found in the EnterpriseObjects document associated to the object being initialized.
 
Methods inherited from class org.openeai.layouts.EnterpriseLayoutManagerImpl
getEnterpriseObjectsUri, getFieldLayout, getLayout, getLayout, getLayoutManagerName, getLayoutRoot, getLength, getTargetAppName, getValueFromObject, getValueFromObject, getValueFromObject, getValueFromObject, instantiate, isDate, isRepeating, isRequired, setEnterpriseObjectsUri, setLayout, setLayoutManagerName, setLayoutRoot, setTargetAppName, setVariableValue, setVariableValue
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openeai.layouts.EnterpriseLayoutManager
getEnterpriseObjectsUri, getLayoutManagerName, getLayoutRoot, setEnterpriseObjectsUri, setLayoutManagerName
 

Constructor Detail

XpathLayout


public XpathLayout()
Constructor

Method Detail

init


public void init(java.lang.String layoutManagerName,
                 org.jdom.Document layoutDoc)
          throws EnterpriseLayoutException
Description copied from interface: EnterpriseLayoutManager
Method used to initialize the LayoutMangager implementation with information found in the EnterpriseObjects document associated to the object being initialized. The layoutmanager implementation retrieves information from the EnterpriseObjects document to tell it how the object should be built from an input and serialized to an output.

Specified by:
init in interface EnterpriseLayoutManager
Overrides:
init in class EnterpriseLayoutManagerImpl
Throws:
EnterpriseLayoutException - if any errors occur initializing the layout manager implementation.

buildOutputFromObject


public java.lang.Object buildOutputFromObject(XmlEnterpriseObject xeo)
                                       throws EnterpriseLayoutException
Description copied from interface: EnterpriseLayoutManager
Method used to serialize an object to some output. An output can be any type of object and it is up to the layout manager implementation to specify what output will be. It is also up to the application developer using that layout manager to cast the returned serialized version of the object to the appropriate type of object that they're expecting. For example, the OpenEAI software foundation includes an XmlLayout manager that all objects use to build themselves from and serialize themselves to XML. This is one implementation of an EnterpriseLayoutManager that expects the output returned from this method to be an XML Element (JDOM Element).

All XmlEnterpriseObject objects inherit a buildOutputFromObject method that makes a call to the Layout manager implementation as specified in the configuration document for that object.

Specified by:
buildOutputFromObject in interface EnterpriseLayoutManager
Returns:
Object the serialized representation of the object.
Throws:
EnterpriseLayoutException - if any errors occur building the object from the input.

buildOutputFromObject


public java.lang.Object buildOutputFromObject(XmlEnterpriseObject anXmlEnterpriseObject,
                                              java.lang.String appName)
                                       throws EnterpriseLayoutException
Description copied from interface: EnterpriseLayoutManager
Method used to serialize an object to some output for a particular application. An output can be any type of object and it is up to the layout manager implementation to specify what output will be. It is also up to the application developer using that layout manager to cast the returned serialized version of the object to the appropriate type of object that they're expecting. For example, the OpenEAI software foundation includes an XmlLayout manager that all objects use to build themselves from and serialize themselves to XML. This is one implementation of an EnterpriseLayoutManager that expects the output returned from this method to be an XML Element (JDOM Element).

This method differs from the buildOutputFromObject(XmlEnterpriseObject) method in that it takes the current 'Enterprise Values' contained within the object and converts them to 'Application Values' that are appropriate for the application name passed in. The rules for these reverse translations are found in the EnterpriseObjects document associated to the object in the application's configuration document.

All XmlEnterpriseObject objects inherit a buildOutputFromObject(String appName) method that makes a call to the Layout manager implementation as specified in the configuration document for that object.

Specified by:
buildOutputFromObject in interface EnterpriseLayoutManager
Returns:
Object the serialized representation of the object.
Throws:
EnterpriseLayoutException - if any errors occur building the object from the input.

buildObjectFromInput


public void buildObjectFromInput(java.lang.Object input,
                                 XmlEnterpriseObject xeo)
                          throws EnterpriseLayoutException
Description copied from interface: EnterpriseLayoutManager
Method used to build an object from an input. An input can be any type of object and it is up to the layout manager implementation to specify what allowable inputs are. For example, the OpenEAI software foundation includes an XmlLayout manager that all objects use to build themselves from and serialize themselves to XML. This is one implementation of an EnterpriseLayoutManager that expects the input passed to this method to be an XML Element (JDOM Element) Other examples, are ExtractLayouts that expect the input to be a String and so on. Those Layout Manager implementations then take the input given to them and build the Java object from that input. How they do this is completely up to the implementors of the layout manager.

All XmlEnterpriseObject objects inherit a buildObjectFromInput method that makes a call to the Layout manager implementation as specified in the configuration document for that object.

Specified by:
buildObjectFromInput in interface EnterpriseLayoutManager
Throws:
EnterpriseLayoutException - if any errors occur building the object from the input.


Copyright © 2002, OpenEAI Software Foundation