org.openeai.layouts
Interface EnterpriseLayoutManager

All Known Implementing Classes:
ComplexResultSetLayout, ExtractLayout, ResultSetLayout, SpCallsLayout, XmlLayout, XpathLayout

public interface EnterpriseLayoutManager

The interface that specifies what methods all EnterpriseLayoutManagers must implement. The implementations of this interface (layout managers) are associated to a message object through an application's configuration document when that object is initialized by AppConfig. A message object may have multiple layout managers associated to it and they can be switched between at runtime. It is these layout managers that provide the logic to build the object from different types of inputs as well as serialize the object to different types of outputs.

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

Method Summary
 void buildObjectFromInput(java.lang.Object input, XmlEnterpriseObject anXmlEnterpriseObject)
          Method used to build an object from an input.
 java.lang.Object buildOutputFromObject(XmlEnterpriseObject anXmlEnterpriseObject)
          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.
 java.lang.String getEnterpriseObjectsUri()
          Returns the EnterpriseObjects document uri associated to this EnterpriseFields object.
 java.lang.String getLayoutManagerName()
          Returns the name associated to the layout manager.
 org.jdom.Element getLayoutRoot()
          Returns the layout manager's root element from the EnterpriseObjects document associated to the MessageObject that was configured.
 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.
 void setEnterpriseObjectsUri(java.lang.String uri)
          Sets the EnterpriseObjects document uri associated to this EnterpriseFields object.
 void setLayoutManagerName(java.lang.String name)
          Sets the name associated to the layout manager.
 

Method Detail

init


public void init(java.lang.String layoutManagerName,
                 org.jdom.Document layoutDoc)
          throws EnterpriseLayoutException
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.

Throws:
EnterpriseLayoutException - if any errors occur initializing the layout manager implementation.

buildObjectFromInput


public void buildObjectFromInput(java.lang.Object input,
                                 XmlEnterpriseObject anXmlEnterpriseObject)
                          throws EnterpriseLayoutException
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.

Throws:
EnterpriseLayoutException - if any errors occur building the object from the input.

buildOutputFromObject


public java.lang.Object buildOutputFromObject(XmlEnterpriseObject anXmlEnterpriseObject)
                                       throws EnterpriseLayoutException
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.

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
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.

Returns:
Object the serialized representation of the object.
Throws:
EnterpriseLayoutException - if any errors occur building the object from the input.

setLayoutManagerName


public void setLayoutManagerName(java.lang.String name)
Sets the name associated to the layout manager.


getLayoutManagerName


public java.lang.String getLayoutManagerName()
Returns the name associated to the layout manager.

Returns:
String the layout manager name.

getLayoutRoot


public org.jdom.Element getLayoutRoot()
Returns the layout manager's root element from the EnterpriseObjects document associated to the MessageObject that was configured.

Returns:
Element

setEnterpriseObjectsUri


public void setEnterpriseObjectsUri(java.lang.String uri)
Sets the EnterpriseObjects document uri associated to this EnterpriseFields object. This document contains the rules that will be use to build the EnterpriseFields object.


getEnterpriseObjectsUri


public java.lang.String getEnterpriseObjectsUri()
Returns the EnterpriseObjects document uri associated to this EnterpriseFields object. This document contains the rules that will be use to build the EnterpriseFields object.

Returns:
String URI to the EnterpriseObjects document. Can be file system or web uri.


Copyright © 2002, OpenEAI Software Foundation